import numpy as np
N = int(input())
S = input()
S = S.replace('.', '0').replace('#', '1')
b = np.array(list(S)).astype(np.int)
w = np.ones(N, dtype=np.int) - b

moves = 200000

for i in range(N + 1):
    left = np.sum(b[:i])
    right = np.sum(w[i:])
    moves = np.min([moves, left + right])

print(moves)
