N = int(input())
S = input()
c = []
c.append(S.count('.'))
c[0] += 1 if S[0] == '#' else -1

for i in range(1, N):
  if S[i] == '#':
    c.append(c[i-1] + 1)

  if S[i] == '.':
    c.append(c[i-1] - 1)

print(min(c))