N = int(input())
S = input()

num_black = S.count('#')
num_white = S.count('.')

if num_white < num_black:
    cnt = 0
    S = S[::-1]
    idx = S.index('#')
    prev = S[idx]
    for i in S[idx:]:
        if prev == i:
            cnt +=1
        else:
            break
else:
    cnt = num_white

            
print(cnt)