#include<bits/stdc++.h>
using namespace std;
int pr(int x){
for(int i = 2; i*i <= x; i++){
if(x % i == 0) return 0;
}
return 1;
}
int main(){
string a;
int b[31];
cin >> a;
for(int i = 0; i < a.length();i++){
if(a[i] != 'r')
b[a[i]-'a']++;
else b[30]++;
}
int max = -1, li = 114514;
for(int i = 1; i <= 26; i++){
if(b[i] > max) max = b[i];
else if(b[i] < li) li = b[i];
}
cout << b[1];
if(pr(max - li)==1) cout << "Lucky Word" << "\n" << max -li;
else cout << 0;
return 0;
}
我的思路好像是对的,结果写出来就有问题(?)