N = int(input())
S = list(input())
x = 0
w = 0
b = 0
while S[x] == ".":
  x += 1
  if x == N:
    break
j = 0
for j in range(N):
  if S[j] == ".":
    w += 1
  else:
    b += 1
if w - x <= b:
  print(w - x)
else:
  print(b)