文件目录

#include <iostream>
#include <cmath>
using namespace std;
bool ispri(int n)
{
    if (n < 2)
        return 0;
    for (int i = 2; i <= sqrt(n); i++)
        if (n % i == 0)
            return 0;
    return 1;
}
int main()
{
    string s;
    cin >> s;
    int a[26] = {};
    int maxn = 0, minn = 100;
    for (int i = 0; s[i]; i++)
    {
        a[s[i] - 'a']++;
        if (maxn < a[s[i] - 'a'])
            maxn = a[s[i] - 'a'];
    }
    for (int i = 0; i < 26; i++)
    {
        if (a[i] != 0 && a[i] < minn)
            minn = a[i];
    }
    if (ispri(maxn - minn))
        cout << "Lucky Word\n"
             << maxn - minn;
    else
        cout << "No Answer\n0";
    return 0;
}