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

num_black= S.count('#')
                   
if num_black == 0:
    print('0')
elif num_black == N:
    print('0')
else:    
    startpos = 0
    for i in S:
        if i == '#':
            break
        startpos+=1
        
    print(N - startpos - num_black)