import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int game = sc.nextInt();

		int tarouPoint = 0;
		int hanakoPoint = 0;

		String tarou;
		String hanako;


		for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		}
		System.out.println(tarouPoint +" "+ hanakoPoint);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int game = sc.nextInt();

		int tarouPoint = 0;
		int hanakoPoint = 0;

		String tarou;
		String hanako;


		for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		}
		System.out.println(tarouPoint +" "+ hanakoPoint);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int game = sc.nextInt();

		int tarouPoint = 0;
		int hanakoPoint = 0;

		String tarou;
		String hanako;


		for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		}
		System.out.println(tarouPoint +" "+ hanakoPoint);
	} main {
		Scanner sc = new Scanner(System.in);

		int game = sc.nextInt();

		int tarouPoint = 0;
		int hanakoPoint = 0;

		String tarou;
		String hanako;


		for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		}
		System.out.println(tarouPoint +" "+ hanakoPoint);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int game = sc.nextInt(); game sc.nextInt() sc.nextInt sc int tarouPoint = 0; tarouPoint 0 int hanakoPoint = 0; hanakoPoint 0 String tarou; tarou String hanako; hanako for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		} int j = 0; int j = 0; j 0 j < game j game j++ j++ j {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		} {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		} tarou = sc.next() tarou sc.next() sc.next sc hanako = sc.next() hanako sc.next() sc.next sc if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			} tarou.equals(hanako) tarou.equals tarou hanako {
				tarouPoint++;
				hanakoPoint++;
				continue;
			} tarouPoint++ tarouPoint hanakoPoint++ hanakoPoint continue; char[] tarouChar = tarou.toCharArray(); tarouChar tarou.toCharArray() tarou.toCharArray tarou char[] hanakoChar = hanako.toCharArray(); hanakoChar hanako.toCharArray() hanako.toCharArray hanako int wordLength = (Math.min(tarouChar.length, hanakoChar.length)); wordLength (Math.min(tarouChar.length, hanakoChar.length)) Math.min Math tarouChar.length tarouChar tarouChar.length hanakoChar.length hanakoChar hanakoChar.length boolean equal = true; equal true for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			} int i = 0; int i = 0; i 0 i < wordLength i wordLength i++ i++ i {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			} {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			} if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				} tarouChar[i] > hanakoChar[i] tarouChar[i] tarouChar i hanakoChar[i] hanakoChar i {
					tarouPoint += 3;
					equal = false;
					break;
				} tarouPoint += 3 tarouPoint 3 equal = false equal false break; if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				} tarouChar[i] < hanakoChar[i] tarouChar[i] tarouChar i hanakoChar[i] hanakoChar i {
					hanakoPoint += 3;
					equal = false;
					break;
				} hanakoPoint += 3 hanakoPoint 3 equal = false equal false break; if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			} equal {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			} if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				} tarouChar.length > hanakoChar.length tarouChar.length tarouChar tarouChar.length hanakoChar.length hanakoChar hanakoChar.length {
					tarouPoint += 3;
				} tarouPoint += 3 tarouPoint 3 {
					hanakoPoint += 3;
				} hanakoPoint += 3 hanakoPoint 3 System.out.println(tarouPoint +" "+ hanakoPoint) System.out.println System.out System System.out tarouPoint +" "+ hanakoPoint tarouPoint +" "+ hanakoPoint tarouPoint " " hanakoPoint String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int game = sc.nextInt();

		int tarouPoint = 0;
		int hanakoPoint = 0;

		String tarou;
		String hanako;


		for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		}
		System.out.println(tarouPoint +" "+ hanakoPoint);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int game = sc.nextInt();

		int tarouPoint = 0;
		int hanakoPoint = 0;

		String tarou;
		String hanako;


		for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		}
		System.out.println(tarouPoint +" "+ hanakoPoint);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int game = sc.nextInt();

		int tarouPoint = 0;
		int hanakoPoint = 0;

		String tarou;
		String hanako;


		for (int j = 0; j < game; j++) {
			tarou = sc.next();
			hanako = sc.next();

			if (tarou.equals(hanako)) {
				tarouPoint++;
				hanakoPoint++;
				continue;
			}

			char[] tarouChar = tarou.toCharArray();
			char[] hanakoChar = hanako.toCharArray();

			int wordLength = (Math.min(tarouChar.length, hanakoChar.length));

			boolean equal = true;
			for (int i = 0; i < wordLength; i++) {
				if (tarouChar[i] > hanakoChar[i]) {
					tarouPoint += 3;
					equal = false;
					break;
				} else if (tarouChar[i] < hanakoChar[i]) {
					hanakoPoint += 3;
					equal = false;
					break;
				}
			}
			if (equal) {
				if (tarouChar.length > hanakoChar.length) {
					tarouPoint += 3;
				} else {
					hanakoPoint += 3;
				}
			}


		}
		System.out.println(tarouPoint +" "+ hanakoPoint);
	}
}
