import numpy as np
N = int(input())
S = input()
S = S.replace('.', '1')
S = S.replace('#', '0')
S = list(map(int, S))
w = np.array(S)
v = w[:-1] - w[1:]
v = np.where(v != 0)[0] + 1
v = np.hstack((v, np.array([len(w)])))
v = np.hstack((np.array([0]), v))
v = v[1:] - v[:-1]
if S[0] == '0':
    v = np.hstack((np.array([0]), v))
if len(v) % 2 != 0:
    v = np.hstack((v,np.array([0])))
v = np.reshape(v, (-1,2)).T
y = [sum(v[0,:n])+sum(v[1,n:]) for n in range(v.shape[1]+1)]
print(min(y))