N = int(input())
S = input()

if N == 1:
  print('0')
  import sys
  sys.exit()

count = 0
for i in range(N-3):
  s = S[i:i+4]
  # print(s)
  if s[1] == '#' and s[2] == '.':
    if s == '##..':
      count += 2
    else:
      count += 1

shead = '.' + S[:3]
stail = S[-3:] + '#'

if shead[1] == '#' and shead[2] == '.':
  if shead == '##..':
    count += 2
  else:
    count += 1

if stail[1] == '#' and stail[2] == '.':
  if stail == '##..':
    count += 2
  else:
    count += 1

# print(shead)
# print(stail)
print(count)