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

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		int turnNum = 0;
		int player1Score = 0;
		int player2Score = 0;

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

		turnNum = Integer.parseInt(br.readLine());

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

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		}
		System.out.println(player1Score + " " + player2Score);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		int turnNum = 0;
		int player1Score = 0;
		int player2Score = 0;

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

		turnNum = Integer.parseInt(br.readLine());

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

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		}
		System.out.println(player1Score + " " + player2Score);
	}
} Main public static void main(String[] args) throws NumberFormatException, IOException {
		int turnNum = 0;
		int player1Score = 0;
		int player2Score = 0;

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

		turnNum = Integer.parseInt(br.readLine());

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

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		}
		System.out.println(player1Score + " " + player2Score);
	} main {
		int turnNum = 0;
		int player1Score = 0;
		int player2Score = 0;

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

		turnNum = Integer.parseInt(br.readLine());

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

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		}
		System.out.println(player1Score + " " + player2Score);
	} int turnNum = 0; turnNum 0 int player1Score = 0; player1Score 0 int player2Score = 0; player2Score 0 BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); br new BufferedReader (new InputStreamReader(System.in)) turnNum = Integer.parseInt(br.readLine()) turnNum Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < turnNum; i++){

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		} int i = 0; int i = 0; i 0 i < turnNum i turnNum i++ i++ i {

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		} {

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		} String[] playerAnimal = (br.readLine()).split(" "); playerAnimal (br.readLine()).split(" ") (br.readLine()).split (br.readLine()) br.readLine br " " int compareResult = playerAnimal[0].compareTo(playerAnimal[1]); compareResult playerAnimal[0].compareTo(playerAnimal[1]) playerAnimal[0].compareTo playerAnimal[0] playerAnimal 0 playerAnimal[1] playerAnimal 1 if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			} compareResult > 0 compareResult 0 {
				player1Score += 3;
			} player1Score += 3 player1Score 3 if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			} compareResult < 0 compareResult 0 {
				player2Score += 3;
			} player2Score += 3 player2Score 3 if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			} compareResult == 0 compareResult 0 {
				player1Score += 1;
				player2Score += 1;
			} player1Score += 1 player1Score 1 player2Score += 1 player2Score 1 System.out.println(player1Score + " " + player2Score) System.out.println System.out System System.out player1Score + " " + player2Score player1Score + " " + player2Score player1Score " " player2Score String[] args args public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		int turnNum = 0;
		int player1Score = 0;
		int player2Score = 0;

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

		turnNum = Integer.parseInt(br.readLine());

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

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		}
		System.out.println(player1Score + " " + player2Score);
	}
} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		int turnNum = 0;
		int player1Score = 0;
		int player2Score = 0;

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

		turnNum = Integer.parseInt(br.readLine());

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

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		}
		System.out.println(player1Score + " " + player2Score);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		int turnNum = 0;
		int player1Score = 0;
		int player2Score = 0;

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

		turnNum = Integer.parseInt(br.readLine());

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

			String[] playerAnimal = (br.readLine()).split(" ");

			int compareResult = playerAnimal[0].compareTo(playerAnimal[1]);

			if (compareResult > 0){
				player1Score += 3;
			} else if (compareResult < 0){
				player2Score += 3;
			} else if (compareResult == 0){
				player1Score += 1;
				player2Score += 1;
			}
		}
		System.out.println(player1Score + " " + player2Score);
	}
}