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

a = 0
b = 0

x = 0
y = 0
z = 0
w = 0
while x == 0 and y<N:
  if S[y] == '.':
    y += 1
  else:
    x = 1
while z == 0 and w<N:
  if S[N-w-1] == '#':
    w += 1
  else:
    z = 1

if y+1 == N:
  print(0)
else:
  for i in range(y+1, N-w):
    if S[i] == '.':
      a += 1
    else:
      b += 1
  print(min(a, b))