N = int(input())
S = str(input())

white = 0
black = 0

if S[N-1] == "#":
  N = N-1

if S[0] ==".":
  N = N-1

for i in range(N):
  if S[i] == "#":
    black +=1
  else:
    white +=1



print(min(white,black))
