N = int(input())
S = list(input())
T = S.copy()
U = S.copy()
U.reverse()

ans1,ans2,ans3,ans4 = 0,0,0,0
for i in range(N):
  if(i != 0):
    if((S[i-1] == '#')and(S[i] == '.')):
      ans1 += 1
      S[i] = '#'
    if((U[i-1] == '.')and(U[i] == '#')):
      ans4 += 1
      U[i] = '.'
  if(T[i] == '#'):ans2 += 1
  if(T[i] == '.'):ans3 += 1
    
ans = min(ans1,ans2,ans3,ans4)
print(ans)