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

def a(str) :
	for i in range(n) :
		if str[i] == "#" : return i
	return -1

index = a(s)
ans = 0
if index != -1 :
  for i in range(index, n) :
      if s[i] == "." : ans +=1
print (ans)