Expanding on what RB1957 was saying...
Start with defining the boundary layer 'transition-line' for every component... at specified flight conditions.
For attached/smooth boundary layer areas [forward of transition line], protruding/rough-anything... including rivets and rough paint can create drag increments. Exception: drag from [for instance] rivet-heads in-a row that all align within a single disturbed airflow field are have drag that is not linearly additive.
For detached/turbulent boundary layer areas [aft of transition], protruding/rough-anything... including rivets and rough paint etc... within the separated boundary layer, essentially contribute no drag increment to the Acft.
WWII fighters were built with this philosophy: In the flow critical areas forward use flush riveting only; however, in the boundary transition, aft, OK to use protruding head rivets. This philosophy led to low-cost, speed-of-assembly [large numbers, lightest construction]... and no significant effects on high speed performance. NOT '100% flush-riveted pretty'... but functional.
Now simply define the numbers of protruding head rivets [X] in the flow critical areas, define the average 'drag cost' per rivet head [Y]; and then do the math... X*Y=Z-total rivet-drag [that must be] overcome by thrust. NOTE: properly installed flush fasteners in the critical boundary layer, have essentially NO drag increment.
REALLY IMPORTANT... Read Hoerner's Fluid Dynamic Drag for a much better understanding of all this complexity.
PS... The drag-effect of a bad paint job can sometimes be worse than protruding head rivets, for all Acft.