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

cnt = 0
count_flag = False
for i in range(0, n-1):
  if s[i] == '#' and s[i+1] =='.':
    count_flag = True
    cnt += 1
  elif s[i+1] == '.' and count_flag:
    cnt += 1
  else:
    count_flag = False

print(cnt)