#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
#import math
#n=int(input())
#li=input().split()
#S=input()
#import fractions
#lis=list(map(int,input().split()))

n=int(input())
s=input()

count=0
flag=-1
for i in range(n):
    if s[i]=="#":
        count+=1
        if flag==-1:
            flag=i
if count==0:
    ans=0
else:
     ans=n-count


print(ans)
