import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int tarou_point = 0,hanako_point = 0;

		Scanner in = new Scanner(System.in);

		int game_num =in.nextInt();

		for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		}

		System.out.println(tarou_point + " " + hanako_point);

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

	public static void main(String[] args) {

		int tarou_point = 0,hanako_point = 0;

		Scanner in = new Scanner(System.in);

		int game_num =in.nextInt();

		for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		}

		System.out.println(tarou_point + " " + hanako_point);

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

		int tarou_point = 0,hanako_point = 0;

		Scanner in = new Scanner(System.in);

		int game_num =in.nextInt();

		for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		}

		System.out.println(tarou_point + " " + hanako_point);

	} main {

		int tarou_point = 0,hanako_point = 0;

		Scanner in = new Scanner(System.in);

		int game_num =in.nextInt();

		for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		}

		System.out.println(tarou_point + " " + hanako_point);

	} int tarou_point = 0 tarou_point 0 hanako_point = 0; hanako_point 0 Scanner in = new Scanner(System.in); in new Scanner(System.in) int game_num =in.nextInt(); game_num in.nextInt() in.nextInt in for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		} int i = 0; int i = 0; i 0 i < game_num i game_num i++ i++ i {

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		} {

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		} String tarou_card = in.next(); tarou_card in.next() in.next in String hanako_card = in.next(); hanako_card in.next() in.next in if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			} tarou_card.compareToIgnoreCase(hanako_card) == 0 tarou_card.compareToIgnoreCase(hanako_card) tarou_card.compareToIgnoreCase tarou_card hanako_card 0 {

				tarou_point += 1;
				hanako_point += 1;

			} tarou_point += 1 tarou_point 1 hanako_point += 1 hanako_point 1 if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			} tarou_card.compareToIgnoreCase(hanako_card) > 0 tarou_card.compareToIgnoreCase(hanako_card) tarou_card.compareToIgnoreCase tarou_card hanako_card 0 {

				tarou_point += 3;

			} tarou_point += 3 tarou_point 3 if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			} tarou_card.compareToIgnoreCase(hanako_card) < 0 tarou_card.compareToIgnoreCase(hanako_card) tarou_card.compareToIgnoreCase tarou_card hanako_card 0 {

				hanako_point += 3;

			} hanako_point += 3 hanako_point 3 System.out.println(tarou_point + " " + hanako_point) System.out.println System.out System System.out tarou_point + " " + hanako_point tarou_point + " " + hanako_point tarou_point " " hanako_point String[] args args public class Main {

	public static void main(String[] args) {

		int tarou_point = 0,hanako_point = 0;

		Scanner in = new Scanner(System.in);

		int game_num =in.nextInt();

		for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		}

		System.out.println(tarou_point + " " + hanako_point);

	}
} public class Main {

	public static void main(String[] args) {

		int tarou_point = 0,hanako_point = 0;

		Scanner in = new Scanner(System.in);

		int game_num =in.nextInt();

		for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		}

		System.out.println(tarou_point + " " + hanako_point);

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int tarou_point = 0,hanako_point = 0;

		Scanner in = new Scanner(System.in);

		int game_num =in.nextInt();

		for(int i = 0; i < game_num; i++){

			String tarou_card = in.next();
			String hanako_card = in.next();

			// System.out.println(tarou_card.compareToIgnoreCase(hanako_card));
			if(tarou_card.compareToIgnoreCase(hanako_card) == 0){

				tarou_point += 1;
				hanako_point += 1;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) > 0){

				tarou_point += 3;

			}else if(tarou_card.compareToIgnoreCase(hanako_card) < 0){

				hanako_point += 3;

			}

		}

		System.out.println(tarou_point + " " + hanako_point);

	}
}