N = int(input())
S = input()
N = [[0 for _ in range(len(S))] for _  in  range(2)]
B,W = 0,1
# 左から.W 右へ#B
for idx,s in enumerate(S):
  if s is "#":
    N[idx][B] = N[idx-1][B] + 1
    N[idx][W] = N[idx-1][W]
  else:
    N[idx][B] = N[idx-1][B]
    N[idx][W] = N[idx-1][W] + 1

print(int(min([N[i][B]+N[-1][W]-N[i][W] for i in range(len(S)-1)]+[N[-1][W],N[-1][B]]   )))
