public class Main {
	public static void main(String[] args){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hana;
		int countt = 0;
		int counth = 0;

		for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			}
		System.out.println(countt +" "+counth);
	}

} public class Main {
	public static void main(String[] args){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hana;
		int countt = 0;
		int counth = 0;

		for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			}
		System.out.println(countt +" "+counth);
	}

} Main public static void main(String[] args){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hana;
		int countt = 0;
		int counth = 0;

		for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			}
		System.out.println(countt +" "+counth);
	} main {
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hana;
		int countt = 0;
		int counth = 0;

		for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			}
		System.out.println(countt +" "+counth);
	} java.util.Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan String taro; taro String hana; hana int countt = 0; countt 0 int counth = 0; counth 0 for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			} {
			taro = scan.next();
			hana = scan.next();

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

		for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			}
		System.out.println(countt +" "+counth);
	}

} public class Main {
	public static void main(String[] args){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hana;
		int countt = 0;
		int counth = 0;

		for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			}
		System.out.println(countt +" "+counth);
	}

} Main
public class Main {
	public static void main(String[] args){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int n = scan.nextInt();
		String taro;
		String hana;
		int countt = 0;
		int counth = 0;

		for(int i = 0; i < n;i++){
			taro = scan.next();
			hana = scan.next();

			if(taro.compareTo(hana) > 0){
				countt += 3;
			}else if(taro.compareTo(hana) < 0){
				counth += 3;
				}else{
					countt++;
					counth++;
				}
			}
		System.out.println(countt +" "+counth);
	}

}