N,S = open(0).read().split()
ans = 0
ls = []
cnt = 1
p = S[0]
for c in S[1:]:
  if p!=c:
    p = c
    ls.append(cnt)
    cnt = 1
  else:
    cnt += 1
ls.append(cnt)
if S[0]=='.':
  ls = ls[1:]
m = sum(ls[i] for i in range(0,len(ls),2))
n = sum(ls)-m
ans = min(n,m)
print(ans)