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

ideal1 = '#' * n
ideal2 = '.' * n
ideal3_dotnum = s.rfind('.') + 1
ideal3 = '.' * ideal3_dotnum + '#' * (n-ideal3_dotnum)

cnt1, cnt2, cnt3 = 0, 0, 0
for i_s, i1, i2, i3 in zip(s, ideal1, ideal2, ideal3):
  if i_s != i1:
    cnt1 += 1
  if i_s != i2:
    cnt2 += 1
  if i_s != i3:
    cnt3 += 1

print(min(cnt1, cnt2, cnt3))