n = int(input().strip())
s = input().strip()
 
exe1 = ""
exe2 = ""
exe3 = ""
 
for i in range(n):
  exe1 = exe1 + "#"
  exe2 = exe2 + "."
  if i < n-1:
    exe3 = exe3 + "."
  else:
    exe3 = exe3 + "#"
    
cnt1 = 0
cnt2 = 0
cnt3 = 0
 
for i in range(n):
  if s[i] != exe1[i]:
    cnt1 += 1
  if s[i] != exe2[i]:
    cnt2 += 1
  if s[i] != exe3[i]:
    cnt3 += 1
    
mincnt = cnt1
if mincnt > cnt2:
  mincnt = cnt2
if mincnt >cnt3:
  mincnt = cnt3
  
print(mincnt)