import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		int taroPoint = 0;
		int hanakoPoint = 0;

		for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		}

		sc.close();

		System.out.println(taroPoint + " " + hanakoPoint);

	}

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		int taroPoint = 0;
		int hanakoPoint = 0;

		for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		}

		sc.close();

		System.out.println(taroPoint + " " + hanakoPoint);

	}

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

		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		int taroPoint = 0;
		int hanakoPoint = 0;

		for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		}

		sc.close();

		System.out.println(taroPoint + " " + hanakoPoint);

	} main {

		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		int taroPoint = 0;
		int hanakoPoint = 0;

		for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		}

		sc.close();

		System.out.println(taroPoint + " " + hanakoPoint);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int taroPoint = 0; taroPoint 0 int hanakoPoint = 0; hanakoPoint 0 for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		} int i=0; int i=0; i 0 i<num i num i++ i++ i {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		} {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		} String taro = sc.next(); taro sc.next() sc.next sc String hanako = sc.next(); hanako sc.next() sc.next sc if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			} taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				hanakoPoint += 3;
			} hanakoPoint += 3 hanakoPoint 3 if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				taroPoint += 3;
			} taroPoint += 3 taroPoint 3 {
				hanakoPoint++;
				taroPoint++;
			} hanakoPoint++ hanakoPoint taroPoint++ taroPoint sc.close() sc.close sc 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 sc = new Scanner(System.in);

		int num = sc.nextInt();

		int taroPoint = 0;
		int hanakoPoint = 0;

		for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		}

		sc.close();

		System.out.println(taroPoint + " " + hanakoPoint);

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		int taroPoint = 0;
		int hanakoPoint = 0;

		for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		}

		sc.close();

		System.out.println(taroPoint + " " + hanakoPoint);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		int taroPoint = 0;
		int hanakoPoint = 0;

		for(int i=0; i<num; i++) {
			String taro = sc.next();
			String hanako = sc.next();
			if(taro.compareTo(hanako) < 0) {
				hanakoPoint += 3;
			} else if(taro.compareTo(hanako) > 0) {
				taroPoint += 3;
			} else {
				hanakoPoint++;
				taroPoint++;
			}
		}

		sc.close();

		System.out.println(taroPoint + " " + hanakoPoint);

	}

}

