n = gets.chomp.to_i
s = gets.chomp

ans = 0

stone_num1 = 0
stone_num2 = 1
stone = s[0]
s.length.times do |i|
    if stone == s[i]
        stone_num2 += 1
    else
        ans += stone_num1 < stone_num2 ? stone_num1 : stone_num2
        stone_num1 = stone_num2
        stone_num2 = 0
        stome = s[i]
    end
end

ans += stone_num1 < stone_num2 ? stone_num1 : stone_num2

puts ans
