
n = int(input())
s = input().strip()
g = list(s)
r = list(s)
k = 0

for i in range(n-1):
  if g[i] == '#' and g[i+1] == '.':
      k+=1
      g[i+1] = '#'
e = 0
for i in range(n-1):
  
  if r[i] == '.' and r[i+1] == '#':
      e+=1
      r[i+1] = '.' 
print(min(e,k))