n = int(input())
S = list(input())
ans = 10**6
s = S.count('#')
d = S.count('.')
ss = 0
dd = 0
for i in range(n):
    if (S[i] == '#'):
        ss += 1
    else:
        dd += 1
    ans = min(ss + d - dd, ans)


print(ans)