n = gets
slime = gets.chomp

merged_slime = ""
slimes = slime.split("")

slimes.each_with_index do |s, i|
  merged_slime = s if i == 0

  next if s == slimes[i+1] || i == 0 || slimes.length-1 == i
  merged_slime += slimes[i+1]
end

puts merged_slime.length