// D - Lucky PIN
#include <bits/stdc++.h>
using namespace std;

int main(){
	int N; string S; cin>>N>>S;
	long long ans = 0;
	for(int i=0; i<1000; i++){
		char c1 = i/100 +'0', c2 = (i%100)/10 +'0', c3 = i%10 +'0';
		int ix;
		for(ix=0; ix<N && S[ix]!=c1; ix++); if(ix==N) continue;
		for(++ix; ix<N && S[ix]!=c2; ix++); if(ix==N) continue;
		for(++ix; ix<N && S[ix]!=c3; ix++); if(ix==N) continue;
		ans++;
	}
	cout<< ans <<endl;
}
### Prompt

Your task is to create a cpp solution to the following problem:

AtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.

The company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.

How many different PIN codes can he set this way?

Both the lucky number and the PIN code may begin with a 0.

Constraints

* 4 \leq N \leq 30000
* S is a string of length N consisting of digits.

Input

Input is given from Standard Input in the following format:


N
S


Output

Print the number of different PIN codes Takahashi can set.

Examples

Input

4
0224


Output

3


Input

6
123123


Output

17


Input

19
3141592653589793238


Output

329

### Response

```cpp
// D - Lucky PIN
#include <bits/stdc++.h>
using namespace std;

int main(){
	int N; string S; cin>>N>>S;
	long long ans = 0;
	for(int i=0; i<1000; i++){
		char c1 = i/100 +'0', c2 = (i%100)/10 +'0', c3 = i%10 +'0';
		int ix;
		for(ix=0; ix<N && S[ix]!=c1; ix++); if(ix==N) continue;
		for(++ix; ix<N && S[ix]!=c2; ix++); if(ix==N) continue;
		for(++ix; ix<N && S[ix]!=c3; ix++); if(ix==N) continue;
		ans++;
	}
	cout<< ans <<endl;
}
```