object Main extends App  {

  import scala.io.StdIn.readLine
  readLine()
  val stamps = readLine().toList

  println(OXCount(stamps))

  def OXCount(stamps: List[Char], count: Int = 0): Int = stamps match {
    case x1 :: x2 :: xs if x1 != x2 => OXCount(xs, count + 1)
    case _ :: x2 :: xs  => OXCount(x2::xs, count)
    case _ => count
  }
}
