#C
N = int(input())
S = str(input())
sign = ('.', '#')
cnt1 = S.count('#')
cnt2 = S.count('.')
tmp = S
for i in range(N):
    if S[i] == '#':
        tmp = S[i:]
        break
cnt3 = tmp.count('.')
print(min(cnt1, cnt2, cnt3))
