import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int left = 0;
        int right = 0;

        for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        }

        System.out.println(left + " " + right);
    }
}
 import java.lang.reflect.Array; Array java.lang.reflect import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java import java.util.stream.Stream; Stream java.util.stream public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int left = 0;
        int right = 0;

        for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        }

        System.out.println(left + " " + right);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int left = 0;
        int right = 0;

        for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        }

        System.out.println(left + " " + right);
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int left = 0;
        int right = 0;

        for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        }

        System.out.println(left + " " + right);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int left = 0; left 0 int right = 0; right 0 for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        } int i=0; int i=0; i 0 i<num i num i++ i++ i {
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        } {
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        } String line1 = sc.next(); line1 sc.next() sc.next sc String line2 = sc.next(); line2 sc.next() sc.next sc if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            } line1.compareTo(line2) < 0 line1.compareTo(line2) line1.compareTo line1 line2 0 {
                right+=3;
            } right+=3 right 3 if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            } line1.compareTo(line2) > 0 line1.compareTo(line2) line1.compareTo line1 line2 0 {
                left+=3;
            } left+=3 left 3 {
                left++;
                right++;
            } left++ left right++ right System.out.println(left + " " + right) System.out.println System.out System System.out left + " " + right left + " " + right left " " right String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int left = 0;
        int right = 0;

        for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        }

        System.out.println(left + " " + right);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int left = 0;
        int right = 0;

        for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        }

        System.out.println(left + " " + right);
    }
} Main
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int left = 0;
        int right = 0;

        for(int i=0; i<num; i++){
            String line1 = sc.next();
            String line2 = sc.next();

            if (line1.compareTo(line2) < 0){
                right+=3;
            } else if (line1.compareTo(line2) > 0){
                left+=3;
            } else {
                left++;
                right++;
            }
        }

        System.out.println(left + " " + right);
    }
}

