N = int(input())
s=list(input())
ii = -1
count = 0
for index, i in enumerate(s):
  if i == '#' and ii == -1:
    ii = index
    continue;
  elif ii == -1:
    continue;
  else:
    if i == '.':
      count+=1
      
print(count)