import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// AtCoder_C
		Scanner sc = new Scanner(System.in);
		Long ans = (long) 0;

		int N = sc.nextInt();
		String S[] = new String[N];
		char SWK[] = new char[11];

		sc.nextLine();
		for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		}

		Arrays.sort(S);

		String nowS = "";
		int indS = 0;

		for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		}

		System.out.println(ans);

		// Scannerクラスのインスタンスをクローズ
		sc.close();
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// AtCoder_C
		Scanner sc = new Scanner(System.in);
		Long ans = (long) 0;

		int N = sc.nextInt();
		String S[] = new String[N];
		char SWK[] = new char[11];

		sc.nextLine();
		for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		}

		Arrays.sort(S);

		String nowS = "";
		int indS = 0;

		for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		}

		System.out.println(ans);

		// Scannerクラスのインスタンスをクローズ
		sc.close();
	}
} Main public static void main(String[] args) {
		// AtCoder_C
		Scanner sc = new Scanner(System.in);
		Long ans = (long) 0;

		int N = sc.nextInt();
		String S[] = new String[N];
		char SWK[] = new char[11];

		sc.nextLine();
		for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		}

		Arrays.sort(S);

		String nowS = "";
		int indS = 0;

		for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		}

		System.out.println(ans);

		// Scannerクラスのインスタンスをクローズ
		sc.close();
	} main {
		// AtCoder_C
		Scanner sc = new Scanner(System.in);
		Long ans = (long) 0;

		int N = sc.nextInt();
		String S[] = new String[N];
		char SWK[] = new char[11];

		sc.nextLine();
		for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		}

		Arrays.sort(S);

		String nowS = "";
		int indS = 0;

		for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		}

		System.out.println(ans);

		// Scannerクラスのインスタンスをクローズ
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Long ans = (long) 0; ans (long) 0 int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String S[] = new String[N]; S new String[N] N char SWK[] = new char[11]; SWK new char[11] 11 sc.nextLine() sc.nextLine sc for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		} {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		} SWK = sc.nextLine().toCharArray() SWK sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc Arrays.sort(SWK) Arrays.sort Arrays SWK S[i] = new String(SWK) S[i] S i new String(SWK) Arrays.sort(S) Arrays.sort Arrays S String nowS = ""; nowS "" int indS = 0; indS 0 for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		} {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		} if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			} nowS.equals(S[i]) nowS.equals nowS S[i] S i {
				ans += (i-indS);
			} ans += (i-indS) ans (i-indS) i indS {
				nowS = S[i];
				indS = i;
			} nowS = S[i] nowS S[i] S i indS = i indS i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		// AtCoder_C
		Scanner sc = new Scanner(System.in);
		Long ans = (long) 0;

		int N = sc.nextInt();
		String S[] = new String[N];
		char SWK[] = new char[11];

		sc.nextLine();
		for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		}

		Arrays.sort(S);

		String nowS = "";
		int indS = 0;

		for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		}

		System.out.println(ans);

		// Scannerクラスのインスタンスをクローズ
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		// AtCoder_C
		Scanner sc = new Scanner(System.in);
		Long ans = (long) 0;

		int N = sc.nextInt();
		String S[] = new String[N];
		char SWK[] = new char[11];

		sc.nextLine();
		for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		}

		Arrays.sort(S);

		String nowS = "";
		int indS = 0;

		for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		}

		System.out.println(ans);

		// Scannerクラスのインスタンスをクローズ
		sc.close();
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// AtCoder_C
		Scanner sc = new Scanner(System.in);
		Long ans = (long) 0;

		int N = sc.nextInt();
		String S[] = new String[N];
		char SWK[] = new char[11];

		sc.nextLine();
		for(int i=0; i<N; i++) {
			SWK = sc.nextLine().toCharArray();
			Arrays.sort(SWK);
			S[i] = new String(SWK);

		}

		Arrays.sort(S);

		String nowS = "";
		int indS = 0;

		for(int i=0; i<N; i++) {
			if(nowS.equals(S[i])) {
				ans += (i-indS);
			} else {
				nowS = S[i];
				indS = i;
			}
		}

		System.out.println(ans);

		// Scannerクラスのインスタンスをクローズ
		sc.close();
	}
}