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

flag = False
count = 0
for i in list(S):
    if(i == '#'):
       if(flag != True):
           flag = True
    else:
        if(flag):
            count += 1
print(count)