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

f = 0
cnt1 = 0
for s_ in s:
  if f == 1 and s_ == ".":
    cnt1 = cnt1 + 1
  if f == 0 and s_ == "#":
    f = 1

f = 0
cnt2 = 0
for s_ in (reversed(s)):
  if f == 0 and s_ == "#":
    f = 1
  if f == 1 and s_ == "#":
    cnt2 = cnt2 + 1

if len(s) == 1:
  print("0")
else:
  print(min(cnt1,cnt2))