N = int(input())
S = input()
first_black = 0
count = 0
for i in range (N):
    if first_black == 0 and S[i]=='#':
        first_black = 1
    if first_black == 1 and S[i]== '.':
        count +=1
        
print(count)