n=int(input())
s=input()
sl=list(s)

c=0
res=0
for i in range(n-1):
	if sl[i]=="#" and sl[i+1]==".":
		res= res + 1
		c=i+1
	elif sl[i]=="." and sl[i+1]=="." and i==c:
		res= res + 1
		c=i+1
print(res)