# coding: utf-8
# Your code here!
N = int(input())
S = list(str(input()))
 
#print(N,S)
 
box = []
a = 1
for i in range(N-1):
    #print(S[i],S[i+1])
    if S[i] == "#" and S[i+1] == "." or S[i] == "." and S[i+1] == "#":
        box.append(a)
        a = 1
        
        
    else:
        a += 1
        
    if i == N-2:
            box.append(a)    
 
#print(box)

BLACK = 0
WHITE = 0
START = 0
STOP = len(box)

if S[0] == ".":
    START = 1
    
if S[N-1] == "#":
    STOP = len(box)-1
    
for i in range(START,STOP):
    if i % 2 == 1:
        BLACK += box[i]
    else:
        WHITE += box[i]

print(min(BLACK,WHITE))