var n = require('fs').readFileSync('/dev/stdin', 'utf8');
var s = require('fs').readFileSync('/dev/stdin', 'utf8');


var length = 1;
var target = s[0];
var result = [target];

for (var i = 1; i < n; i++) {
    if (target === s[i]) continue;
    target = s[i];
    result.push(target);
}

console.log(result.length);