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

X = [0 if x == '#' else 1 for x in S] # 0:black 1:white

ans = N - sum(X)

for i in range(N):
    x = i - sum(X[:i])
    y = sum(X[i:])
    ans = min(x+y, ans)

print(ans)