Emily's birthday is next week and Jack has decided to buy a present for her. He knows she loves books so he goes to the local bookshop, where there are n books on sale from one of m genres.

In the bookshop, Jack decides to buy two books of different genres.

Based on the genre of books on sale in the shop, find the number of options available to Jack for choosing two books of different genres for Emily. Options are considered different if they differ in at least one book.

The books are given by indices of their genres. The genres are numbered from 1 to m.

Input

The first line contains two positive integers n and m (2 ≤ n ≤ 2·105, 2 ≤ m ≤ 10) — the number of books in the bookstore and the number of genres.

The second line contains a sequence a1, a2, ..., an, where ai (1 ≤ ai ≤ m) equals the genre of the i-th book.

It is guaranteed that for each genre there is at least one book of that genre.

Output

Print the only integer — the number of ways in which Jack can choose books.

It is guaranteed that the answer doesn't exceed the value 2·109.

Examples

Input

4 3
2 1 3 1


Output

5


Input

7 4
4 2 3 1 2 4 3


Output

18

Note

The answer to the first test sample equals 5 as Sasha can choose:

  1. the first and second books, 
  2. the first and third books, 
  3. the first and fourth books, 
  4. the second and third books, 
  5. the third and fourth books. 
100 10
7 4 5 5 10 10 5 8 5 7 4 5 4 6 8 8 2 6 3 3 10 7 10 8 6 2 7 3 9 7 7 2 4 5 2 4 9 5 10 1 10 5 10 4 1 3 4 2 6 9 9 9 10 6 2 5 6 1 8 10 4 10 3 4 10 5 5 4 10 4 5 3 7 10 2 7 3 6 9 6 1 6 5 5 4 6 6 4 4 1 5 1 6 6 6 8 8 6 2 6
 3 2
1 2 2
 12 3
1 2 3 1 2 3 1 2 3 1 2 3
 100 3
2 1 1 1 3 2 3 3 2 3 3 1 3 3 1 3 3 1 1 1 2 3 1 2 3 1 2 3 3 1 3 1 1 2 3 2 3 3 2 3 3 1 2 2 1 2 3 2 3 2 2 1 1 3 1 3 2 1 3 1 3 1 3 1 1 3 3 3 2 3 2 2 2 2 1 3 3 3 1 2 1 2 3 2 1 3 1 3 2 1 3 1 2 1 2 3 1 3 2 3
 100 5
5 5 2 4 5 4 4 4 4 2 5 3 4 2 4 4 1 1 5 3 2 2 1 3 3 2 5 3 4 5 1 3 5 4 4 4 3 1 4 4 3 4 5 2 5 4 2 1 2 2 3 5 5 5 1 4 5 3 1 4 2 2 5 1 5 3 4 1 5 1 2 2 3 5 1 3 2 4 2 4 2 2 4 1 3 5 2 2 2 3 3 4 3 2 2 5 5 4 2 5
 9 2
1 1 1 1 2 1 1 1 1
 10 10
1 2 3 4 5 6 7 8 9 10
 2 2
1 2

4428
 2
 48
 3296
 3953
 8
 45
 1

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class a {
	public static int k;

	public static class node implements Comparable<node> {
		int x;
		long freq;
		int pos;

		node(int x, long f, int p) {
			this.x = x;
			freq = f;
			pos = p;

		}

		@Override
		public int compareTo(node o) {
			if (o.x < x)
				return 1;
			else if (o.x > x)
				return -1;
			else if (o.pos < pos)
				return 1;
			else if (o.pos > pos)
				return -1;
			else
				return 0;
		}

	}

	public static class point {
		int x;
		int y;

		point(int x, int val) {
			this.x = x;
			this.y = val;
		}

	}

	public static BigInteger gcd(BigInteger a, BigInteger b) {
		if (b.equals(BigInteger.ZERO))
			return a;
		return gcd(b, a.mod(b));
	}

	public static long gcd1(long a, long b) {
		if (b == 0)
			return a;
		return gcd1(b, a % b);
	}

	public static ArrayList<Integer> prime;

	public static void sieve(int n) {
		boolean vis[] = new boolean[n + 5];
		vis[1] = true;
		vis[0] = true;
		for (int i = 2; i <= n; i++) {
			if (!vis[i]) {
				prime.add(i);
				for (long j = (long) i * (long) i; j <= n; j += i) {
					vis[(int) j] = true;
				}
			}
		}
	}

	public static int tree[][];
	public static boolean end[][];
	public static int counter;

	public static void trie(String a) {
		int st = 0;

		for (int i = 0; i < a.length(); i++) {
			if (tree[a.charAt(i) - 'a'][st] == 0) {
				tree[a.charAt(i) - 'a'][st] = counter++;
			}

			st = tree[a.charAt(i) - 'a'][st];
		}
		end[a.charAt(a.length() - 1) - 'a'][st] = true;

	}

	public static int seg[][];

	public static int get(int s, int e, int p, int from, int to, int seg[]) {
		if (s >= from && e <= to)
			return seg[p];
		if (s > to || e < from)
			return 0;
		int mid = (s + e) / 2;
		int one = get(s, mid, p * 2, from, to, seg);
		int two = get(mid + 1, e, p * 2 + 1, from, to, seg);
		return Math.max(one, two);
	}

	public static long comp(int n, int r) {
		long ans = 1;
		r = Math.min(r, n - r);
		for (int i = 1; i <= r; i++) {
			ans = ans * ((long) n - (long) i + 1L) / (long) i;
		}
		return ans;
	}

	public static ArrayList<Integer> arr[];
	public static boolean vis[];
	public static Stack<Integer> S;

	public static void bfs(int node) {
		for (int i = 0; i < arr[node].size(); i++) {
			int k = arr[node].get(i);
			if (vis[k] == false) {
				vis[k] = true;
				S.push(k);
				bfs(k);
			}
		}
		S.push(node);
	}

	public static void dfs(int node) {

		for (int i = 0; i < arr[node].size(); i++) {
			int k = arr[node].get(i);
			if (vis[k] == false) {
				vis[k] = true;
				dfs(k);
			}
		}
	}

	public static boolean chPrime(int r) {

		for (int i = 2; i * i <= r; i++) {
			if (r % i == 0)
				return false;
		}
		return true;
	}

	public static int len(long ai) {
		String temp = "" + ai;

		return temp.length();
	}

	public static int f_digit(long ai) {
		String temp = "" + ai;

		return (temp.charAt(0) - '0');

	}

	public static int binary(int a[], int val) {

		int low = 0;
		int high = a.length;

		int mid = (low + high) / 2;
		while (high - low > 1) {
			if (a[mid] <= val) {
				low = mid;
			} else if (a[mid] > val)
				high = mid;

			mid = (low + high) / 2;
		}
		if (a[high] == val)
			return high;
		return low;
	}

	public static long mod = (long) Math.pow(10, 9) + 7;

	public static int bin(int a[], int val) {

		int low = 0;
		int high = a.length - 1;

		int mid = (low + high) / 2;

		while (high - low > 1) {
			if (a[mid] > val) {
				high = mid;
			} else
				low = mid;

			mid = (low + high) / 2;
		}

		return high;

	}

	public static int lcs(int a[]) {

		int size[] = new int[a.length];
		int arr[] = new int[a.length];
		Arrays.fill(arr, Integer.MAX_VALUE);
		size[0] = 1;
		arr[0] = a[0];
		int max = 1;
		for (int i = 1; i < a.length; i++) {
			int get = Arrays.binarySearch(arr, a[i]);
			if (get < 0) {
				get *= -1;
				get--;
			}

			size[i] = get + 1;
			arr[get] = a[i];
			max = Math.max(max, get + 1);
		}

		return max;
	}

	private static ArrayList<Integer> siev(int max) {
		boolean prime[] = new boolean[max + 1];
		ArrayList<Integer> ans = new ArrayList();
		for (int i = 2; i * i <= max; i++) {
			if (!prime[i]) {
				for (int j = i * i; j <= max; j += i)
					prime[j] = true;

			}
		}

		for (int i = 2; i <= max; i++)
			if (!prime[i])
				ans.add(i);

		return ans;

	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader in = new BufferedReader(new FileReader("cubes.in"));
		// System.out.println(-70 % 3);
		int aa[] = { 1, 2, 5 };

		// System.out.println(Arrays.binarySearch(aa, 2));

		StringBuilder qq = new StringBuilder();
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

		String y[] = in.readLine().split(" ");
		int n = Integer.parseInt(y[0]);
		int m = Integer.parseInt(y[1]);
		int a[] = new int[12];
		y = in.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			a[Integer.parseInt(y[i])]++;
		}
		long ans = 0;
		for (int i = 1; i <= 10; i++) {
			ans += a[i] * (n - a[i]);
			n -= a[i];
		}
		System.out.println(ans);

		out.close();

	}
}
