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

itr = 0
for i in s:
  if i not in ".":
    break
  itr += 1

w = 0
b = 0
while itr < n:
  if s[itr] in "#":
    b += 1
  else:
    w += 1
  itr += 1

if w > b:
  print(b)
else:
  print(w)