#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string str;
int n;
cin >> n >> str;
int id = 0, ans = 0, pre = -1;
while(id < n) {
if(pre == -1) {
pre = id++;
} else {
if(str[id] == str[pre]) {
ans++;
id++;
} else {
pre = id++;
}
}
}
cout << ans << endl;
return 0;
}
266A - Stones on the Table
最新推荐文章于 2024-06-06 14:07:38 发布