import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		// ??\??????????????????????????????Scanner???????????§???????????????
		Scanner scan = new Scanner(System.in);

		// ??????????????°??????????????????
		int n = scan.nextInt();

		// ????????¨??±??????????????????????????????????????°?????£?¨?
		int taroPoint = 0;
		int hanakoPoint = 0;

		// ??????????????°?????°???????????????
		for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		}
		// ???????????¨???
		System.out.println(taroPoint + " " + hanakoPoint);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		// ??\??????????????????????????????Scanner???????????§???????????????
		Scanner scan = new Scanner(System.in);

		// ??????????????°??????????????????
		int n = scan.nextInt();

		// ????????¨??±??????????????????????????????????????°?????£?¨?
		int taroPoint = 0;
		int hanakoPoint = 0;

		// ??????????????°?????°???????????????
		for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		}
		// ???????????¨???
		System.out.println(taroPoint + " " + hanakoPoint);
	}

} Main public static void main(String[] args) {

		// ??\??????????????????????????????Scanner???????????§???????????????
		Scanner scan = new Scanner(System.in);

		// ??????????????°??????????????????
		int n = scan.nextInt();

		// ????????¨??±??????????????????????????????????????°?????£?¨?
		int taroPoint = 0;
		int hanakoPoint = 0;

		// ??????????????°?????°???????????????
		for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		}
		// ???????????¨???
		System.out.println(taroPoint + " " + hanakoPoint);
	} main {

		// ??\??????????????????????????????Scanner???????????§???????????????
		Scanner scan = new Scanner(System.in);

		// ??????????????°??????????????????
		int n = scan.nextInt();

		// ????????¨??±??????????????????????????????????????°?????£?¨?
		int taroPoint = 0;
		int hanakoPoint = 0;

		// ??????????????°?????°???????????????
		for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		}
		// ???????????¨???
		System.out.println(taroPoint + " " + hanakoPoint);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int taroPoint = 0; taroPoint 0 int hanakoPoint = 0; hanakoPoint 0 for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		} {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		} String taroCade = scan.next(); taroCade scan.next() scan.next scan String hanakoCade = scan.next(); hanakoCade scan.next() scan.next scan int temp = taroCade.compareTo(hanakoCade); temp taroCade.compareTo(hanakoCade) taroCade.compareTo taroCade hanakoCade if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			} temp > 0 temp 0 {
				taroPoint += 3;
			} taroPoint += 3 taroPoint 3 if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			} temp == 0 temp 0 {
				taroPoint += 1;
				hanakoPoint += 1;
			} taroPoint += 1 taroPoint 1 hanakoPoint += 1 hanakoPoint 1 if (temp < 0) {
				hanakoPoint += 3;
			} temp < 0 temp 0 {
				hanakoPoint += 3;
			} hanakoPoint += 3 hanakoPoint 3 System.out.println(taroPoint + " " + hanakoPoint) System.out.println System.out System System.out taroPoint + " " + hanakoPoint taroPoint + " " + hanakoPoint taroPoint " " hanakoPoint String[] args args public class Main {

	public static void main(String[] args) {

		// ??\??????????????????????????????Scanner???????????§???????????????
		Scanner scan = new Scanner(System.in);

		// ??????????????°??????????????????
		int n = scan.nextInt();

		// ????????¨??±??????????????????????????????????????°?????£?¨?
		int taroPoint = 0;
		int hanakoPoint = 0;

		// ??????????????°?????°???????????????
		for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		}
		// ???????????¨???
		System.out.println(taroPoint + " " + hanakoPoint);
	}

} public class Main {

	public static void main(String[] args) {

		// ??\??????????????????????????????Scanner???????????§???????????????
		Scanner scan = new Scanner(System.in);

		// ??????????????°??????????????????
		int n = scan.nextInt();

		// ????????¨??±??????????????????????????????????????°?????£?¨?
		int taroPoint = 0;
		int hanakoPoint = 0;

		// ??????????????°?????°???????????????
		for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		}
		// ???????????¨???
		System.out.println(taroPoint + " " + hanakoPoint);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		// ??\??????????????????????????????Scanner???????????§???????????????
		Scanner scan = new Scanner(System.in);

		// ??????????????°??????????????????
		int n = scan.nextInt();

		// ????????¨??±??????????????????????????????????????°?????£?¨?
		int taroPoint = 0;
		int hanakoPoint = 0;

		// ??????????????°?????°???????????????
		for (int i = 0; i < n; i++) {

			// ??????????????????????????????
			String taroCade = scan.next();
			String hanakoCade = scan.next();

			// ?????????????????????????????§??????????????????????????????????????????compareTo()???????????????(??? ???????????????????¨????)
			int temp = taroCade.compareTo(hanakoCade);

			// temp???0????????§???????????????????°?????????§??????????????????????????????
			if (temp > 0) {
				taroPoint += 3;
			} else if (temp == 0) {
				taroPoint += 1;
				hanakoPoint += 1;
			} else if (temp < 0) {
				hanakoPoint += 3;
			}
		}
		// ???????????¨???
		System.out.println(taroPoint + " " + hanakoPoint);
	}

}