N=input();S=input();
b_num, w_num = 0, 0
if '#' in S:
    S = S[S.index('#'):]
    w_num = S.index('#')
if '.' in S:
    R = S[::-1]
    R = R[R.index('.'):]
    S = R[::-1]
    b_num = S.index('.')

try:
    print(min(S.count('.') + w_num, S.count('#') + b_num))
except ValueError:
    print(0)
