import java.util.Scanner;
import java.io.*;

class Main {
    public static void main(String[] args)throws IOException{ 
    	InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader read = new BufferedReader(in);
    	   	                                                 
    	int n = Integer.parseInt(read.readLine());
        int taroP = 0;
        int hanaP = 0;

        for(int N = 0; N < n; N++){
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        }
        System.out.println(taroP+" "+hanaP);
    }
} import java.util.Scanner; Scanner java.util import java.io.*; io.* java class Main {
    public static void main(String[] args)throws IOException{ 
    	InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader read = new BufferedReader(in);
    	   	                                                 
    	int n = Integer.parseInt(read.readLine());
        int taroP = 0;
        int hanaP = 0;

        for(int N = 0; N < n; N++){
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        }
        System.out.println(taroP+" "+hanaP);
    }
} Main public static void main(String[] args)throws IOException{ 
    	InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader read = new BufferedReader(in);
    	   	                                                 
    	int n = Integer.parseInt(read.readLine());
        int taroP = 0;
        int hanaP = 0;

        for(int N = 0; N < n; N++){
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        }
        System.out.println(taroP+" "+hanaP);
    } main { 
    	InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader read = new BufferedReader(in);
    	   	                                                 
    	int n = Integer.parseInt(read.readLine());
        int taroP = 0;
        int hanaP = 0;

        for(int N = 0; N < n; N++){
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        }
        System.out.println(taroP+" "+hanaP);
    } InputStreamReader in = new InputStreamReader(System.in); in new InputStreamReader(System.in) BufferedReader read = new BufferedReader(in); read new BufferedReader(in) int n = Integer.parseInt(read.readLine()); n Integer.parseInt(read.readLine()) Integer.parseInt Integer read.readLine() read.readLine read int taroP = 0; taroP 0 int hanaP = 0; hanaP 0 for(int N = 0; N < n; N++){
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        } int N = 0; int N = 0; N 0 N < n N n N++ N++ N {
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        } {
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        } String line = read.readLine(); line read.readLine() read.readLine read String [] tarohana = line.split(" "); tarohana line.split(" ") line.split line " " if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                } tarohana[0].compareTo(tarohana[1]) > 0 tarohana[0].compareTo(tarohana[1]) tarohana[0].compareTo tarohana[0] tarohana 0 tarohana[1] tarohana 1 0 {
                taroP = taroP + 3;
                } taroP = taroP + 3 taroP taroP + 3 taroP 3 if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                } tarohana[0].compareTo(tarohana[1]) < 0 tarohana[0].compareTo(tarohana[1]) tarohana[0].compareTo tarohana[0] tarohana 0 tarohana[1] tarohana 1 0 {
                hanaP = hanaP + 3;
                } hanaP = hanaP + 3 hanaP hanaP + 3 hanaP 3 if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                } tarohana[0].compareTo(tarohana[1]) == 0 tarohana[0].compareTo(tarohana[1]) tarohana[0].compareTo tarohana[0] tarohana 0 tarohana[1] tarohana 1 0 {
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                } taroP = taroP + 1 taroP taroP + 1 taroP 1 hanaP = hanaP + 1 hanaP hanaP + 1 hanaP 1 System.out.println(taroP+" "+hanaP) System.out.println System.out System System.out taroP+" "+hanaP taroP+" "+hanaP taroP " " hanaP String[] args args
import java.util.Scanner;
import java.io.*;

class Main {
    public static void main(String[] args)throws IOException{ 
    	InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader read = new BufferedReader(in);
    	   	                                                 
    	int n = Integer.parseInt(read.readLine());
        int taroP = 0;
        int hanaP = 0;

        for(int N = 0; N < n; N++){
           // String taro = read.readLine();
           // String hana = read.readLine();
        	
        	String line = read.readLine();
        	String [] tarohana = line.split(" ");

                if(tarohana[0].compareTo(tarohana[1]) > 0){
                taroP = taroP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) < 0){
                hanaP = hanaP + 3;
                }
                else if(tarohana[0].compareTo(tarohana[1]) == 0){
                 taroP = taroP + 1;
                 hanaP = hanaP + 1;
                }
        }
        System.out.println(taroP+" "+hanaP);
    }
}