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

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