n = int(input())
s = input()
s = list(s)
t = s
c = 0
for i in range(n-2):
  if t[i] == '#' and t[i+1] == '.' and t[i+2] == '#':
    t[i] = '.'
    c+=1
    
for i in range(n-1):
  if t[i] == '#' and t[i+1] == '.':
    t[i+1] = '#'
    c+=1

print(c)