N = int(input())
S = input()
t = S.count(".")
if t == N:
    print(0)
    exit(0)

b = 0
for k in range(N):
    if S[k] == "#":
        b = k
        break

print(min(t,S.count("#"),S[b:].count(".")))