N = int(input())
S = input()

a = S.find('#')
b = 0
c = 0

if a < 0:
    print('0')

else:
    for k in range(a, N):
        if S[k] == '.':
            b = b + 1
        else:
            c = c + 1
    if S[N-1] == '#':
        c = c - 1
    print(min(b,c))
