import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taro_point = 0;
		int hanako_point = 0;
		int num = Integer.parseInt(br.readLine());

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

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

		}

		System.out.println(taro_point + " " + hanako_point);

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taro_point = 0;
		int hanako_point = 0;
		int num = Integer.parseInt(br.readLine());

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

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

		}

		System.out.println(taro_point + " " + hanako_point);

	}
} Main public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taro_point = 0;
		int hanako_point = 0;
		int num = Integer.parseInt(br.readLine());

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

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

		}

		System.out.println(taro_point + " " + hanako_point);

	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taro_point = 0;
		int hanako_point = 0;
		int num = Integer.parseInt(br.readLine());

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

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

		}

		System.out.println(taro_point + " " + hanako_point);

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int taro_point = 0; taro_point 0 int hanako_point = 0; hanako_point 0 int num = Integer.parseInt(br.readLine()); num Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i = 0; i < num; i++){

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

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

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

		} {

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

		} String[] token = br.readLine().split(" "); token br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " String taro_card = token[0]; taro_card token[0] token 0 String hanako_card = token[1]; hanako_card token[1] token 1 int compare = taro_card.compareTo(hanako_card); compare taro_card.compareTo(hanako_card) taro_card.compareTo taro_card hanako_card if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			} compare < 0 compare 0 {
				hanako_point += 3;
			} hanako_point += 3 hanako_point 3 if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			} compare > 0 compare 0 {
				taro_point += 3;
			} taro_point += 3 taro_point 3 if(compare == 0){
				taro_point++;
				hanako_point++;
			} compare == 0 compare 0 {
				taro_point++;
				hanako_point++;
			} taro_point++ taro_point hanako_point++ hanako_point System.out.println(taro_point + " " + hanako_point) System.out.println System.out System System.out taro_point + " " + hanako_point taro_point + " " + hanako_point taro_point " " hanako_point String[] args args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taro_point = 0;
		int hanako_point = 0;
		int num = Integer.parseInt(br.readLine());

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

			String[] token = br.readLine().split(" ");
			String taro_card = token[0];
			String hanako_card = token[1];
			int compare = taro_card.compareTo(hanako_card);

			if(compare < 0){
				hanako_point += 3;
			}else if(compare > 0){
				taro_point += 3;
			}else if(compare == 0){
				taro_point++;
				hanako_point++;
			}

		}

		System.out.println(taro_point + " " + hanako_point);

	}
}