#include using namespace std; int main(){ int N; string S; cin >> N >> S; vector C(10, 0); for (char c : S) C[c-'0']++; int ans = 0; for (int n = 0; n < 1000; n++){ auto c = C; bool ok = true; c[n%10]--, c[(n/10)%10]--, c[n/100]--; for (int x : c) if (x < 0) ok = false; if (ok) ans++; } cout << ans << endl; }