N = int(input())
S = str(input())
first_B = S.find('#')
if first_B == -1:
    answer = 0
else:
    S = S[first_B:]
#    print(S)
    n_W = S.count('.')
    n_B = S.count('#')
    if n_W > n_B:
        answer = n_B
    else:
        answer = n_W
print (answer)