import java.util.Scanner;


public class Main{

	public static void main(String[] args){
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		//??????????????°??????
		int n = scan.nextInt();
		String strTcard = "";
		String strHcard = "";
		int Tscore = 0;
		int Hscore = 0;

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		}
		scan.close();
		System.out.println(Tscore + " " + Hscore);
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args){
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		//??????????????°??????
		int n = scan.nextInt();
		String strTcard = "";
		String strHcard = "";
		int Tscore = 0;
		int Hscore = 0;

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		}
		scan.close();
		System.out.println(Tscore + " " + Hscore);
	}
} Main public static void main(String[] args){
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		//??????????????°??????
		int n = scan.nextInt();
		String strTcard = "";
		String strHcard = "";
		int Tscore = 0;
		int Hscore = 0;

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		}
		scan.close();
		System.out.println(Tscore + " " + Hscore);
	} main {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		//??????????????°??????
		int n = scan.nextInt();
		String strTcard = "";
		String strHcard = "";
		int Tscore = 0;
		int Hscore = 0;

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		}
		scan.close();
		System.out.println(Tscore + " " + Hscore);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan String strTcard = ""; strTcard "" String strHcard = ""; strHcard "" int Tscore = 0; Tscore 0 int Hscore = 0; Hscore 0 for(int i = 0; i < n; i++){

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		} {

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		} strTcard = scan.next() strTcard scan.next() scan.next scan strHcard = scan.next() strHcard scan.next() scan.next scan int resultNum = strTcard.compareTo(strHcard); resultNum strTcard.compareTo(strHcard) strTcard.compareTo strTcard strHcard if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			} resultNum == 0 resultNum 0 {
				Tscore += 1;
				Hscore += 1;
			} Tscore += 1 Tscore 1 Hscore += 1 Hscore 1 if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			} 0 < resultNum 0 resultNum {
				Tscore += 3;
			} Tscore += 3 Tscore 3 {
				Hscore += 3;
			} Hscore += 3 Hscore 3 scan.close() scan.close scan System.out.println(Tscore + " " + Hscore) System.out.println System.out System System.out Tscore + " " + Hscore Tscore + " " + Hscore Tscore " " Hscore String[] args args public class Main{

	public static void main(String[] args){
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		//??????????????°??????
		int n = scan.nextInt();
		String strTcard = "";
		String strHcard = "";
		int Tscore = 0;
		int Hscore = 0;

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		}
		scan.close();
		System.out.println(Tscore + " " + Hscore);
	}
} public class Main{

	public static void main(String[] args){
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		//??????????????°??????
		int n = scan.nextInt();
		String strTcard = "";
		String strHcard = "";
		int Tscore = 0;
		int Hscore = 0;

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		}
		scan.close();
		System.out.println(Tscore + " " + Hscore);
	}
} Main
import java.util.Scanner;


public class Main{

	public static void main(String[] args){
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);
		//??????????????°??????
		int n = scan.nextInt();
		String strTcard = "";
		String strHcard = "";
		int Tscore = 0;
		int Hscore = 0;

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

			strTcard = scan.next();
			strHcard = scan.next();
			//????????????????????°????????????

			//???????????????????????????
			int resultNum = strTcard.compareTo(strHcard);

			if(resultNum == 0 ){
				Tscore += 1;
				Hscore += 1;
			}else if(0 < resultNum){
				Tscore += 3;
			}else{
				Hscore += 3;
			}

		}
		scan.close();
		System.out.println(Tscore + " " + Hscore);
	}
}