N = int(input())
S = input()
s1 = '#'
i = 0
slis = []
ini = True

for s in S:
  if s == s1:
    i += 1
  if s != s1:
    if ini:
      slis.append(i)
      ini = False
    else:
      slis.append(i + 1)
    s1 = s
    i = 0

slis.append(i+1)

if S.startswith('.'):
  sum1 = sum(slis[2::2])
  sum2 = sum(slis[3::2])
else:
  sum1 = sum(slis[0::2])
  sum2 = sum(slis[1::2])

print(min(sum1, sum2))