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

class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String num = br.readLine();

		String[] words ;

		int player1_score =0;

		int player2_score =0;

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

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		}

		System.out.println(player1_score+" "+player2_score);


	}

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

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String num = br.readLine();

		String[] words ;

		int player1_score =0;

		int player2_score =0;

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

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		}

		System.out.println(player1_score+" "+player2_score);


	}

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String num = br.readLine();

		String[] words ;

		int player1_score =0;

		int player2_score =0;

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

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		}

		System.out.println(player1_score+" "+player2_score);


	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String num = br.readLine();

		String[] words ;

		int player1_score =0;

		int player2_score =0;

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

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		}

		System.out.println(player1_score+" "+player2_score);


	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String num = br.readLine(); num br.readLine() br.readLine br String[] words ; words int player1_score =0; player1_score 0 int player2_score =0; player2_score 0 for(int i=0; i<Integer.parseInt(num); i++){

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		} int i=0; int i=0; i 0 i<Integer.parseInt(num) i Integer.parseInt(num) Integer.parseInt Integer num i++ i++ i {

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		} {

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		} words = br.readLine().split(" ") words br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			} (words[0].compareTo(words[1])) < 0 (words[0].compareTo(words[1])) words[0].compareTo words[0] words 0 words[1] words 1 0 {

				player2_score += 3;
			} player2_score += 3 player2_score 3 if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			} (words[0].compareTo(words[1])) > 0 (words[0].compareTo(words[1])) words[0].compareTo words[0] words 0 words[1] words 1 0 {
				player1_score +=3;
			} player1_score +=3 player1_score 3 {
				player1_score +=1;
				player2_score +=1;
			} player1_score +=1 player1_score 1 player2_score +=1 player2_score 1 System.out.println(player1_score+" "+player2_score) System.out.println System.out System System.out player1_score+" "+player2_score player1_score+" "+player2_score player1_score " " player2_score String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String num = br.readLine();

		String[] words ;

		int player1_score =0;

		int player2_score =0;

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

			words = br.readLine().split(" ");
			if((words[0].compareTo(words[1])) < 0){

				player2_score += 3;
			}else if ((words[0].compareTo(words[1])) > 0) {
				player1_score +=3;
			}else {
				player1_score +=1;
				player2_score +=1;
			}
		}

		System.out.println(player1_score+" "+player2_score);


	}

}