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

ans = N
for i in range(N + 1):
    left_num = S[:i].count('#')
    right_num = S[i:].count('.')
    if right_num in [0, N - i]:
        ans = min(ans, left_num)
        break
    else:
        ans = min(ans, (left_num + right_num))
print(ans)