fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val d = readLine()!!.split("").filter { it.isNotEmpty() }
    println(op143c(n, d))
}

fun op143c(n: Int, d: List<String>): Int {
    val result = mutableListOf<String>()
    d.forEachIndexed { index, s ->
        if (index == 0) {
            result.add(s)
        } else if (result.last() != s) {
            result.add(s)
        }
    }
    return result.count()
}


