N = int(input())
S = list(input())
count1 = 0
count2 = 0
count = 0
counter = []

for i in range(N):
    if S[i] == '.':
        count2 += 1
        
for i in range(N-1):
    if S[i:i+2] == ['#','.']:
        count1 += 1
        if count:
            counter.append(count)
        count = 0
        S[i] = '.'
    elif S[i:i+2] == ['#', '#']:
        count += 1
    else:
        if count:
            counter.append(count)
        count = 0

for i in counter:
    count1 += i
    
print(min(count1, count2))
