

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//??£?¨?
		int HanakoPoint = 0;
		int TaroPoint = 0;
		//??????????????°?????????
		int n = sc.nextInt();
		//???????????° ??°?????????
		for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		}
			//??????????????????????????¨???
			System.out.println(TaroPoint + " "+ HanakoPoint);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//??£?¨?
		int HanakoPoint = 0;
		int TaroPoint = 0;
		//??????????????°?????????
		int n = sc.nextInt();
		//???????????° ??°?????????
		for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		}
			//??????????????????????????¨???
			System.out.println(TaroPoint + " "+ HanakoPoint);
	}
} Main public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//??£?¨?
		int HanakoPoint = 0;
		int TaroPoint = 0;
		//??????????????°?????????
		int n = sc.nextInt();
		//???????????° ??°?????????
		for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		}
			//??????????????????????????¨???
			System.out.println(TaroPoint + " "+ HanakoPoint);
	} main {
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//??£?¨?
		int HanakoPoint = 0;
		int TaroPoint = 0;
		//??????????????°?????????
		int n = sc.nextInt();
		//???????????° ??°?????????
		for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		}
			//??????????????????????????¨???
			System.out.println(TaroPoint + " "+ HanakoPoint);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int HanakoPoint = 0; HanakoPoint 0 int TaroPoint = 0; TaroPoint 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		} int i = 0; int i = 0; i 0 i< n i n i++ i++ i {
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		} {
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		} String Tarocard = sc.next(); Tarocard sc.next() sc.next sc String Hanakocard = sc.next(); Hanakocard sc.next() sc.next sc if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			} Tarocard.compareToIgnoreCase(Hanakocard) < 0 Tarocard.compareToIgnoreCase(Hanakocard) Tarocard.compareToIgnoreCase Tarocard Hanakocard 0 {
			//?????? 3????????????
				HanakoPoint += 3;
			} HanakoPoint += 3 HanakoPoint 3 if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			} Tarocard.compareToIgnoreCase(Hanakocard) == 0 Tarocard.compareToIgnoreCase(Hanakocard) Tarocard.compareToIgnoreCase Tarocard Hanakocard 0 {
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			} TaroPoint ++ TaroPoint HanakoPoint++ HanakoPoint {
			//?????? 0????????????
				TaroPoint += 3;
			} TaroPoint += 3 TaroPoint 3 System.out.println(TaroPoint + " "+ HanakoPoint) System.out.println System.out System System.out TaroPoint + " "+ HanakoPoint TaroPoint + " "+ HanakoPoint TaroPoint " " HanakoPoint String[] args args public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//??£?¨?
		int HanakoPoint = 0;
		int TaroPoint = 0;
		//??????????????°?????????
		int n = sc.nextInt();
		//???????????° ??°?????????
		for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		}
			//??????????????????????????¨???
			System.out.println(TaroPoint + " "+ HanakoPoint);
	}
} public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//??£?¨?
		int HanakoPoint = 0;
		int TaroPoint = 0;
		//??????????????°?????????
		int n = sc.nextInt();
		//???????????° ??°?????????
		for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		}
			//??????????????????????????¨???
			System.out.println(TaroPoint + " "+ HanakoPoint);
	}
} Main


import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);
		//??£?¨?
		int HanakoPoint = 0;
		int TaroPoint = 0;
		//??????????????°?????????
		int n = sc.nextInt();
		//???????????° ??°?????????
		for(int i = 0; i< n; i++){
			//???????????????
			String Tarocard = sc.next();
			//??±????????????
			String Hanakocard = sc.next();
			//???????????????????????????
			if(Tarocard.compareToIgnoreCase(Hanakocard) < 0){
			//?????? 3????????????
				HanakoPoint += 3;
			}else if(Tarocard.compareToIgnoreCase(Hanakocard) == 0){
			//???????????? //1????????????
				TaroPoint ++;
				HanakoPoint++;
			}else{
			//?????? 0????????????
				TaroPoint += 3;
			}
		}
			//??????????????????????????¨???
			System.out.println(TaroPoint + " "+ HanakoPoint);
	}
}