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

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