A = int(input())
B = input()
B += ' '
C = B
cnt = 0
x = 0
for i in range(0,A):
  if B[i] == '#' and B[i+1] == '.':
    B = B.replace(B[i+1], '#', 1)
    cnt += 1
for i in range(0, A):
  if C[i] == '#' and C[i+1] == '.':
    C = C.replace(C[i], '.', 1)
    x += 1

if cnt <= x:
  print(cnt)
else:
  print(x)