index = int(input())
s = input()
a = []
for i in s:
  a.append(i)

count = 0
for j in range(index):
  for i in range(index-1):
    if a[i] == '#' and a[i+1] == '.':
      count += 1
      a[i] = '.'
      
print(count)
        
  