266A - Stones On Table
28 Jan 2021 — Tags: None
Click to show code.
using namespace std;
int main(void)
{
int n, last, ans = 0;
string s;
cin >> n >> s;
last = 0;
for (auto c : s)
{
if (c == last)
++ans;
last = c;
}
cout << ans << endl;
return 0;
}