import java.util.Scanner;

//20180511
//01

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

		int turn = scanner.nextInt();
		int pointTaro = 0;
		int pointHanako = 0;

		for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		}

		System.out.printf("%d %d\n",pointTaro,pointHanako);

		scanner.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);

		int turn = scanner.nextInt();
		int pointTaro = 0;
		int pointHanako = 0;

		for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		}

		System.out.printf("%d %d\n",pointTaro,pointHanako);

		scanner.close();
    }
} Main public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);

		int turn = scanner.nextInt();
		int pointTaro = 0;
		int pointHanako = 0;

		for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		}

		System.out.printf("%d %d\n",pointTaro,pointHanako);

		scanner.close();
    } main {
		Scanner scanner = new Scanner(System.in);

		int turn = scanner.nextInt();
		int pointTaro = 0;
		int pointHanako = 0;

		for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		}

		System.out.printf("%d %d\n",pointTaro,pointHanako);

		scanner.close();
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int turn = scanner.nextInt(); turn scanner.nextInt() scanner.nextInt scanner int pointTaro = 0; pointTaro 0 int pointHanako = 0; pointHanako 0 for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		} int i = 0; int i = 0; i 0 i < turn i turn i++ i++ i {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		} {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		} String taro = scanner.next(); taro scanner.next() scanner.next scanner String hanako = scanner.next(); hanako scanner.next() scanner.next scanner if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			} taro.compareTo(hanako) == 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				pointTaro += 1;
				pointHanako += 1;
			} pointTaro += 1 pointTaro 1 pointHanako += 1 pointHanako 1 if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				pointTaro += 3;
			} pointTaro += 3 pointTaro 3 {
				pointHanako += 3;
			} pointHanako += 3 pointHanako 3 System.out.printf("%d %d\n",pointTaro,pointHanako) System.out.printf System.out System System.out "%d %d\n" pointTaro pointHanako scanner.close() scanner.close scanner String[] args args public class Main {
    public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);

		int turn = scanner.nextInt();
		int pointTaro = 0;
		int pointHanako = 0;

		for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		}

		System.out.printf("%d %d\n",pointTaro,pointHanako);

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

		int turn = scanner.nextInt();
		int pointTaro = 0;
		int pointHanako = 0;

		for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		}

		System.out.printf("%d %d\n",pointTaro,pointHanako);

		scanner.close();
    }
} Main
import java.util.Scanner;

//20180511
//01

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

		int turn = scanner.nextInt();
		int pointTaro = 0;
		int pointHanako = 0;

		for(int i = 0;i < turn;i++) {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) == 0) {
				pointTaro += 1;
				pointHanako += 1;
			} else if (taro.compareTo(hanako) > 0) {
				pointTaro += 3;
			} else {
				pointHanako += 3;
			}
		}

		System.out.printf("%d %d\n",pointTaro,pointHanako);

		scanner.close();
    }
}
