n = int(input())
S = input()
A = list(S)
B = list(S)
c0 = 0
for i in range(n-1):
  if A[i] + A[i+1] == '#.':
    c0 += 1
    A[i+1] = '#'
c1 = 0
for i in range(n-1):
  if B[i] + B[i+1] == '#.':
    c1 += 1
    B[i] = '.'
print(max(c0, c1))