#include using namespace std; #define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++) #define rrep(i, r, l) for (int i = (int)(r); i > (int)(l); i--) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() void solve() { int n = 8; string s; cin >> s; map change = {{'l', '1'}, {'o', '0'}, {'a', '@'}, {'s', '$'}}; set ans; auto f = [&](char c) -> char { if (change.find(c) == change.end()) { return c; } else { return change[c]; } }; rep(bit, 0, 1 << n) { string t; bool num = false; bool chr = false; bool syn = false; rep(i, 0, n) { char c = s[i]; if (bit & (1 << i)) { c = f(s[i]); } if (c == '1' || c == '0') { num = true; } else if (c == '@' || c == '$') { syn = true; } else { chr = true; } t.push_back(c); } if (num && syn && chr) { ans.insert(t); } } cout << ans.size() << '\n'; } int main() { int q = 1; // cin >> q; while (q--) { solve(); } }