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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        execute(br);
    }   

    private static void execute(BufferedReader br) throws Exception {
        int n = Integer.parseInt(br.readLine());
        int taro = 0, hanako = 0;
        for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        }   
        System.out.println(taro + " " + hanako);
    }   
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        execute(br);
    }   

    private static void execute(BufferedReader br) throws Exception {
        int n = Integer.parseInt(br.readLine());
        int taro = 0, hanako = 0;
        for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        }   
        System.out.println(taro + " " + hanako);
    }   
} Main public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        execute(br);
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        execute(br);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) execute(br) execute br String[] args args private static void execute(BufferedReader br) throws Exception {
        int n = Integer.parseInt(br.readLine());
        int taro = 0, hanako = 0;
        for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        }   
        System.out.println(taro + " " + hanako);
    } execute {
        int n = Integer.parseInt(br.readLine());
        int taro = 0, hanako = 0;
        for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        }   
        System.out.println(taro + " " + hanako);
    } int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int taro = 0 taro 0 hanako = 0; hanako 0 for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        } {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        } String[] strs = br.readLine().split(" "); strs br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            } strs[0].compareTo(strs[1]) > 0 strs[0].compareTo(strs[1]) strs[0].compareTo strs[0] strs 0 strs[1] strs 1 0 {
                taro += 3;
            } taro += 3 taro 3 if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            } strs[0].compareTo(strs[1]) < 0 strs[0].compareTo(strs[1]) strs[0].compareTo strs[0] strs 0 strs[1] strs 1 0 {
                hanako += 3;   
            } hanako += 3 hanako 3 if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            } strs[0].compareTo(strs[1]) == 0 strs[0].compareTo(strs[1]) strs[0].compareTo strs[0] strs 0 strs[1] strs 1 0 {
                taro++;
                hanako++;
            } taro++ taro hanako++ hanako System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako BufferedReader br br public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        execute(br);
    }   

    private static void execute(BufferedReader br) throws Exception {
        int n = Integer.parseInt(br.readLine());
        int taro = 0, hanako = 0;
        for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        }   
        System.out.println(taro + " " + hanako);
    }   
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        execute(br);
    }   

    private static void execute(BufferedReader br) throws Exception {
        int n = Integer.parseInt(br.readLine());
        int taro = 0, hanako = 0;
        for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        }   
        System.out.println(taro + " " + hanako);
    }   
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        execute(br);
    }   

    private static void execute(BufferedReader br) throws Exception {
        int n = Integer.parseInt(br.readLine());
        int taro = 0, hanako = 0;
        for (int i = 0; i < n; i++) {
            String[] strs = br.readLine().split(" ");
            if (strs[0].compareTo(strs[1]) > 0) {
                taro += 3;
            }   
            else if(strs[0].compareTo(strs[1]) < 0) {
                hanako += 3;   
            }   
            else if(strs[0].compareTo(strs[1]) == 0) {
                taro++;
                hanako++;
            }   
        }   
        System.out.println(taro + " " + hanako);
    }   
}