import numpy as np

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

ans = [np.zeros(N), np.zeros(N)]

for i in range(N):
    if S[i] == "#":
        ans[0][i:] += 1
    else:
        ans[1][:i+1] += 1

a = [ans[1][0]]
for i in range(N-1):
    a.append(ans[0][i]+ans[1][i+1])
a.append(ans[0][N-1])

print(min(a))