N = int(input())
S = list(input())
if S == ['.'] * N:
    print(0)
    exit()
ans = N - S.count('#')
ans0 = 10**9
for i in range(N):
    ans0 = min(ans, ans0)
    if S[i] == '.':
        ans -= 1
    else:
        ans += 1

print(ans0)