import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int intLoop = scan.nextInt();
		String strTaro = "";
		String strHana = "";
		int intTaro = 0;
		int intHana = 0;

		for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		}
		System.out.println(intTaro + " " + intHana);
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int intLoop = scan.nextInt();
		String strTaro = "";
		String strHana = "";
		int intTaro = 0;
		int intHana = 0;

		for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		}
		System.out.println(intTaro + " " + intHana);
		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int intLoop = scan.nextInt();
		String strTaro = "";
		String strHana = "";
		int intTaro = 0;
		int intHana = 0;

		for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		}
		System.out.println(intTaro + " " + intHana);
		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int intLoop = scan.nextInt();
		String strTaro = "";
		String strHana = "";
		int intTaro = 0;
		int intHana = 0;

		for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		}
		System.out.println(intTaro + " " + intHana);
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int intLoop = scan.nextInt(); intLoop scan.nextInt() scan.nextInt scan String strTaro = ""; strTaro "" String strHana = ""; strHana "" int intTaro = 0; intTaro 0 int intHana = 0; intHana 0 for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		} int i = 0; int i = 0; i 0 i < intLoop i intLoop i++ i++ i {
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		} {
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		} strTaro = scan.next() strTaro scan.next() scan.next scan strHana = scan.next() strHana scan.next() scan.next scan int intJudge = strTaro.compareTo(strHana); intJudge strTaro.compareTo(strHana) strTaro.compareTo strTaro strHana if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			} intJudge < 0 intJudge 0 {
				intHana += 3;
			} intHana += 3 intHana 3 if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			} intJudge == 0 intJudge 0 {
				intTaro++;
				intHana++;
			} intTaro++ intTaro intHana++ intHana if(0 < intJudge){
				intTaro += 3;
			} 0 < intJudge 0 intJudge {
				intTaro += 3;
			} intTaro += 3 intTaro 3 System.out.println(intTaro + " " + intHana) System.out.println System.out System System.out intTaro + " " + intHana intTaro + " " + intHana intTaro " " intHana scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int intLoop = scan.nextInt();
		String strTaro = "";
		String strHana = "";
		int intTaro = 0;
		int intHana = 0;

		for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		}
		System.out.println(intTaro + " " + intHana);
		scan.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int intLoop = scan.nextInt();
		String strTaro = "";
		String strHana = "";
		int intTaro = 0;
		int intHana = 0;

		for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		}
		System.out.println(intTaro + " " + intHana);
		scan.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int intLoop = scan.nextInt();
		String strTaro = "";
		String strHana = "";
		int intTaro = 0;
		int intHana = 0;

		for(int i = 0; i < intLoop; i++){
			strTaro = scan.next();
			strHana = scan.next();
			int intJudge = strTaro.compareTo(strHana);
			if(intJudge < 0){
				intHana += 3;
			}else if(intJudge == 0){
				intTaro++;
				intHana++;
			}else if(0 < intJudge){
				intTaro += 3;
			}
		}
		System.out.println(intTaro + " " + intHana);
		scan.close();
	}
}