N = input()
S = input()
#print(N,S)
count=0
num = 0

if not "#" in S or not "." in S:
  print(0)
else:
  #S_r = list(reversed(S))
  #print(S_r)
  for i in range(len(S)):
    #print(i, S[i])
    if S[i] == "#":
      num = i
      #print(num)
      break
    else:
      continue
  #print(num)
  print(S[num:].count("."))

