N = int(input())
S = input()
for x in range(N):
    if x == 0:
        ans = S.count(".")
        continue
    count = S[:x].count("#") + S[x:].count(".")
    if count < ans:
        ans = count
count = S.count("#")
if count < ans:
    ans = count
print(ans)