링크 : https://www.acmicpc.net/problem/1316
#include <iostream>
#include <string>
using namespace std;
int main(){
int n;
int cnt = 0;
string s;
cin >> n;
for(int i=0; i<n; i++){
cin >> s;
bool flag = true;
for(int j=0; j<s.length(); j++){
for(int k=0; k<j; k++){
if(s[j] != s[j-1] && s[j] == s[k]){
flag = false;
break;
}
}
}
if(flag) cnt++;
}
cout << cnt;
return 0;
}