import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
		//System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int n =scan.nextInt();
		String taro;
		String hanako;
		int taroWin = 0;
		int hanakoWin = 0;
		for(int kaisuu=0; kaisuu<n; kaisuu++){
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		}
		System.out.println(taroWin+" "+hanakoWin);
	}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
		//System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int n =scan.nextInt();
		String taro;
		String hanako;
		int taroWin = 0;
		int hanakoWin = 0;
		for(int kaisuu=0; kaisuu<n; kaisuu++){
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		}
		System.out.println(taroWin+" "+hanakoWin);
	}
} Main public static void main(String[] args)throws NumberFormatException, IOException{
		//System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int n =scan.nextInt();
		String taro;
		String hanako;
		int taroWin = 0;
		int hanakoWin = 0;
		for(int kaisuu=0; kaisuu<n; kaisuu++){
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		}
		System.out.println(taroWin+" "+hanakoWin);
	} main {
		//System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int n =scan.nextInt();
		String taro;
		String hanako;
		int taroWin = 0;
		int hanakoWin = 0;
		for(int kaisuu=0; kaisuu<n; kaisuu++){
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		}
		System.out.println(taroWin+" "+hanakoWin);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n =scan.nextInt(); n scan.nextInt() scan.nextInt scan String taro; taro String hanako; hanako int taroWin = 0; taroWin 0 int hanakoWin = 0; hanakoWin 0 for(int kaisuu=0; kaisuu<n; kaisuu++){
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		} int kaisuu=0; int kaisuu=0; kaisuu 0 kaisuu<n kaisuu n kaisuu++ kaisuu++ kaisuu {
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		} {
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		} taro = scan.next() taro scan.next() scan.next scan hanako = scan.next() hanako scan.next() scan.next scan taro = taro + "0" taro taro + "0" taro "0" hanako = hanako + "0" hanako hanako + "0" hanako "0" char[] taroChar = taro.toCharArray(); taroChar taro.toCharArray() taro.toCharArray taro char[] hanakoChar = hanako.toCharArray(); hanakoChar hanako.toCharArray() hanako.toCharArray hanako for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			} int i=0; int i=0; i 0 i<taro.length() && i<hanako.length() i<taro.length() i taro.length() taro.length taro i<hanako.length() i hanako.length() hanako.length hanako i++ i++ i {
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			} {
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			} String charToString = String.valueOf(taroChar[i]); charToString String.valueOf(taroChar[i]) String.valueOf String taroChar[i] taroChar i byte[] taroNumber = charToString.getBytes("US-ASCII"); taroNumber charToString.getBytes("US-ASCII") charToString.getBytes charToString "US-ASCII" charToString = String.valueOf(hanakoChar[i]) charToString String.valueOf(hanakoChar[i]) String.valueOf String hanakoChar[i] hanakoChar i byte[] hanakoNumber = charToString.getBytes("US-ASCII"); hanakoNumber charToString.getBytes("US-ASCII") charToString.getBytes charToString "US-ASCII" if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				} taroNumber[0] > hanakoNumber[0] taroNumber[0] taroNumber 0 hanakoNumber[0] hanakoNumber 0 {
					taroWin += 2;
					hanakoWin -= 1;
					break;
				} taroWin += 2 taroWin 2 hanakoWin -= 1 hanakoWin 1 break; if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				} taroNumber[0] < hanakoNumber[0] taroNumber[0] taroNumber 0 hanakoNumber[0] hanakoNumber 0 {
					hanakoWin += 2;
					taroWin -= 1;
					break;
				} hanakoWin += 2 hanakoWin 2 taroWin -= 1 taroWin 1 break; taroWin += 1 taroWin 1 hanakoWin += 1 hanakoWin 1 System.out.println(taroWin+" "+hanakoWin) System.out.println System.out System System.out taroWin+" "+hanakoWin taroWin+" "+hanakoWin taroWin " " hanakoWin String[] args args
import java.io.IOException;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
		//System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		int n =scan.nextInt();
		String taro;
		String hanako;
		int taroWin = 0;
		int hanakoWin = 0;
		for(int kaisuu=0; kaisuu<n; kaisuu++){
			taro = scan.next();
			hanako = scan.next();
			taro = taro + "0";
			hanako = hanako + "0";
			char[] taroChar = taro.toCharArray();
			char[] hanakoChar = hanako.toCharArray();
			for(int i=0;i<taro.length() && i<hanako.length(); i++){
				//?????????????????????
				String charToString = String.valueOf(taroChar[i]);
				byte[] taroNumber = charToString.getBytes("US-ASCII");
				charToString = String.valueOf(hanakoChar[i]);
				byte[] hanakoNumber = charToString.getBytes("US-ASCII");
//				System.out.println(taroNumber[0]+" "+hanakoNumber[0]);
				if(taroNumber[0] > hanakoNumber[0]){
					taroWin += 2;
					hanakoWin -= 1;
					break;
				}
				else if(taroNumber[0] < hanakoNumber[0]){
					hanakoWin += 2;
					taroWin -= 1;
					break;
				}
			}
			taroWin += 1;
			hanakoWin += 1;
		}
		System.out.println(taroWin+" "+hanakoWin);
	}
}