#include using namespace std; using ll = long long; int main(){ int N; cin >> N; vector S(N); for(int i=0; i> S[i]; } sort(S.begin(), S.end()); set st; do{ string s = ""; for(auto str: S){ s = s+str; } st.insert(s); }while(next_permutation(S.begin(), S.end())); cout << st.size(); }