n = int(input())
s = str(input())

count_A = 0
count_B = 0

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

if count_B > count_A:
 print(count_A)
else:
 print(count_B)