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

for i in range(n-1):
  if s[i] == '#' and s[i+1] == '.':
    s[i] = '.'
    cnt+=1

print(cnt)