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

a = 0
b = 0

x = 0
y = 0

while x == 0:
  if S[y] =='.':
    y += 1
  else:
    x =1

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

print(min(a, b))