public class Main {
	public static void main(String[] args) {
		try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		}
	}
} Main public static void main(String[] args) {
		try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		}
	} main {
		try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		}
	} try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} java.util.Scanner sc = new java.util.Scanner(System.in) java.util.Scanner sc = new java.util.Scanner(System.in) new java.util.Scanner(System.in) int cnt = sc.nextInt(); cnt sc.nextInt() sc.nextInt sc int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			} int i = 0; int i = 0; i 0 i < cnt i cnt i++ i++ i {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			} {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			} String strTaro = sc.next(); strTaro sc.next() sc.next sc String strHanako = sc.next(); strHanako sc.next() sc.next sc int compare = strTaro.compareTo(strHanako); compare strTaro.compareTo(strHanako) strTaro.compareTo strTaro strHanako if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				} compare > 0 compare 0 {
					taro += 3;
				} taro += 3 taro 3 if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				} compare < 0 compare 0 {
					hanako += 3;
				} hanako += 3 hanako 3 {
					taro++;
					hanako++;
				} taro++ taro hanako++ hanako System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main {
	public static void main(String[] args) {
		try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		}
	}
} Main
public class Main {
	public static void main(String[] args) {
		try (java.util.Scanner sc = new java.util.Scanner(System.in)) {
			int cnt = sc.nextInt();
			int taro = 0;
			int hanako = 0;

			for (int i = 0; i < cnt; i++) {
				String strTaro = sc.next();
				String strHanako = sc.next();
				int compare = strTaro.compareTo(strHanako);

				if (compare > 0) {
					taro += 3;
				} else if (compare < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		}
	}
}
