import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hanako;
		int point_taro = 0;
		int point_hanako = 0;
		for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		}
		System.out.println(point_taro + " " + point_hanako);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hanako;
		int point_taro = 0;
		int point_hanako = 0;
		for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		}
		System.out.println(point_taro + " " + point_hanako);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hanako;
		int point_taro = 0;
		int point_hanako = 0;
		for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		}
		System.out.println(point_taro + " " + point_hanako);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hanako;
		int point_taro = 0;
		int point_hanako = 0;
		for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		}
		System.out.println(point_taro + " " + point_hanako);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan String taro; taro String hanako; hanako int point_taro = 0; point_taro 0 int point_hanako = 0; point_hanako 0 for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		} {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		} taro = scan.next() taro scan.next() scan.next scan hanako = scan.next() hanako scan.next() scan.next scan if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			} taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				point_hanako += 3;
			} point_hanako += 3 point_hanako 3 if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				point_taro += 3;
			} point_taro += 3 point_taro 3 {
				point_taro += 1;
				point_hanako += 1;
			} point_taro += 1 point_taro 1 point_hanako += 1 point_hanako 1 System.out.println(point_taro + " " + point_hanako) System.out.println System.out System System.out point_taro + " " + point_hanako point_taro + " " + point_hanako point_taro " " point_hanako String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hanako;
		int point_taro = 0;
		int point_hanako = 0;
		for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		}
		System.out.println(point_taro + " " + point_hanako);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hanako;
		int point_taro = 0;
		int point_hanako = 0;
		for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		}
		System.out.println(point_taro + " " + point_hanako);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hanako;
		int point_taro = 0;
		int point_hanako = 0;
		for (int i = 0; i < n; i++) {
			taro = scan.next();
			hanako = scan.next();
			if (taro.compareTo(hanako) < 0) {
				point_hanako += 3;
			} else if (taro.compareTo(hanako) > 0) {
				point_taro += 3;
			} else {
				point_taro += 1;
				point_hanako += 1;
			}
		}
		System.out.println(point_taro + " " + point_hanako);
	}
}