n = int(input())
s = input()

ans = 0

wh,bl = 0,0
bl2,wh2 = 0,0

for i in range(n):
  if s[i] == '.':
    wh += 1
    if bl2 == 1:
      wh2 += 1
  else:
    if bl2 == 0:
      bl2 = 1
    bl += 1

ans = min(bl,wh,wh2)
print (ans)