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

print(min(ans[0][N-1], ans[1][0], np.min(ans[0][1:]+ans[1][:N-1])))