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

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taroScore = 0;
		int hanakoScore = 0;
		int number = Integer.parseInt(br.readLine());
		for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
} 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 {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taroScore = 0;
		int hanakoScore = 0;
		int number = Integer.parseInt(br.readLine());
		for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
} Main public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taroScore = 0;
		int hanakoScore = 0;
		int number = Integer.parseInt(br.readLine());
		for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taroScore = 0;
		int hanakoScore = 0;
		int number = Integer.parseInt(br.readLine());
		for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int taroScore = 0; taroScore 0 int hanakoScore = 0; hanakoScore 0 int number = Integer.parseInt(br.readLine()); number Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		} int i = 0; int i = 0; i 0 i < number i number i++ i++ i {
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		} {
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		} String[] cardName = br.readLine().split(" "); cardName br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			} cardName[0].compareTo(cardName[1]) > 0 cardName[0].compareTo(cardName[1]) cardName[0].compareTo cardName[0] cardName 0 cardName[1] cardName 1 0 {
				taroScore += 3;
			} taroScore += 3 taroScore 3 if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			} cardName[0].compareTo(cardName[1]) == 0 cardName[0].compareTo(cardName[1]) cardName[0].compareTo cardName[0] cardName 0 cardName[1] cardName 1 0 {
				taroScore += 1;
				hanakoScore += 1;
			} taroScore += 1 taroScore 1 hanakoScore += 1 hanakoScore 1 {
				hanakoScore += 3;
			} hanakoScore += 3 hanakoScore 3 System.out.println(taroScore + " " + hanakoScore) System.out.println System.out System System.out taroScore + " " + hanakoScore taroScore + " " + hanakoScore taroScore " " hanakoScore String[] args args public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taroScore = 0;
		int hanakoScore = 0;
		int number = Integer.parseInt(br.readLine());
		for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
} public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taroScore = 0;
		int hanakoScore = 0;
		int number = Integer.parseInt(br.readLine());
		for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
} 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 {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int taroScore = 0;
		int hanakoScore = 0;
		int number = Integer.parseInt(br.readLine());
		for(int i = 0;i < number;i++){
			String[] cardName = br.readLine().split(" ");
			if(cardName[0].compareTo(cardName[1]) > 0){
				taroScore += 3;
			}
			else if(cardName[0].compareTo(cardName[1]) == 0){
				taroScore += 1;
				hanakoScore += 1;
			}
			else{
				hanakoScore += 3;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
}