# coding: utf-8

N = int(input())
S = input().strip()

def stone_cnt(idx):
  return S[:idx].count("#") + S[idx:].count(".")

pre = 2 * 10 ** 5

for i in range(len(S)):
  ans = stone_cnt(i)
  if ans > pre:
    break
  pre = ans

print(pre)
