n = gets
s = gets.chomp.split("")
count = 0
prev = nil
s.each{|c|
    if !c.nil? && ([c, prev] == ["O", "X"] || [c, prev] == ["X", "O"])
        count += 1
        prev = nil
    else
        prev = c
    end
}
puts count
