stones_count = int(input())
input_str = input()

target = input_str[0]

def set_next_target(target_char):
  if target_char == '#':
    return '.'
  else:
    return '#'

stones = ''
stones_list = []

for i in range(stones_count):
  #print(input_str[i],target)
  if input_str[i] == target:
    stones = stones + target
  else:
    stones_list.append(stones)
    target = set_next_target(target)
    stones = target

stones_list.append(stones)
#print(len(stones_list))

if len(stones_list) == 1:
  print(0)
elif len(stones_list) == 3:
  print(1)
elif len(stones_list) %2 == 0:
  print(len(stones_list) // 2)
else:
  print(len(stones_list) // 2 - 1)