P9488 [AtCoder] Sumitomo Mitsui Trust Bank Programming Contest 2019 - Lucky PIN
普及
题目描述

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

输入格式

见题面

输出格式

见题面

样例输入
4 0224
样例输出
3