#include #include #include using namespace std; set ans; void dfs(string tmp1, string tmp2, string tmp3) { if (tmp1.size() == 0) ans.insert(tmp2 + tmp3); else if (tmp1.size() == 1) dfs("", tmp2 + tmp3, tmp1.substr(0, 1)); else { dfs(tmp1.substr(0, tmp1.size() - 1), tmp2 + tmp3, tmp1.substr(tmp1.size() - 1, 1)); dfs(tmp1.substr(1, tmp1.size() - 1), tmp2 + tmp3, tmp1.substr(0, 1)); } } int main() { string S; cin >> S; dfs(S.substr(0, S.size() - 1), "", S.substr(S.size() - 1, 1)); dfs(S.substr(1, S.size() - 1), "", S.substr(0, 1)); cout << ans.size(); }