N = int(input())
S = str(input())
new_S = ""
for i in reversed(S):
    new_S += i

for i in range(N):
    if new_S[i] == ".":
        S_new = S[i:]
        break
else:
    S_new = ""

print(min(S_new.count('#'), S_new.count('.'), len(S_new)))
