#C
N = int(input())
S = str(input())
sign = ('.', '#')
ans = 2*10**5
if N == 1:
    print(0)
else:
    for i in range(1,N):
        ls, rs = S[:i], S[i:]
        c1 = ls.count('#')
        c2 = rs.count('.')
        tmp = c1 + c2
        ans = min(ans, tmp)
    print(ans)
