문제
풀이
#include <iostream>
#include <string>
using namespace std;
void solve(void) {
int n; cin >> n;
string s; cin >> s;
int ans = 1;
for (int i=1; i<n; i++) {
if (s[i-1] == 'W' && s[i] == 'E') ans++;
}
cout << ans;
}
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}