import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String t;
        String h;
        int t_point = 0;
        int h_point = 0;
        int n = sc.nextInt();
        for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        }
        System.out.println(t_point + " " + h_point);
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String t;
        String h;
        int t_point = 0;
        int h_point = 0;
        int n = sc.nextInt();
        for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        }
        System.out.println(t_point + " " + h_point);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String t;
        String h;
        int t_point = 0;
        int h_point = 0;
        int n = sc.nextInt();
        for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        }
        System.out.println(t_point + " " + h_point);
    } main {
        Scanner sc = new Scanner(System.in);
        String t;
        String h;
        int t_point = 0;
        int h_point = 0;
        int n = sc.nextInt();
        for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        }
        System.out.println(t_point + " " + h_point);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String t; t String h; h int t_point = 0; t_point 0 int h_point = 0; h_point 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        } {
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        } t = sc.next() t sc.next() sc.next sc h = sc.next() h sc.next() sc.next sc if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            } t.compareTo(h) > 0 t.compareTo(h) t.compareTo t h 0 {
                t_point += 3;
            } t_point += 3 t_point 3 if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            } t.compareTo(h) < 0 t.compareTo(h) t.compareTo t h 0 {
                h_point += 3;
            } h_point += 3 h_point 3 {
                t_point += 1;
                h_point += 1;
            } t_point += 1 t_point 1 h_point += 1 h_point 1 System.out.println(t_point + " " + h_point) System.out.println System.out System System.out t_point + " " + h_point t_point + " " + h_point t_point " " h_point String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String t;
        String h;
        int t_point = 0;
        int h_point = 0;
        int n = sc.nextInt();
        for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        }
        System.out.println(t_point + " " + h_point);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String t;
        String h;
        int t_point = 0;
        int h_point = 0;
        int n = sc.nextInt();
        for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        }
        System.out.println(t_point + " " + h_point);
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String t;
        String h;
        int t_point = 0;
        int h_point = 0;
        int n = sc.nextInt();
        for(int i = 0; i < n ;i++){
            t = sc.next();
            h = sc.next();
            if(t.compareTo(h) > 0){
                t_point += 3;
            }
            else if(t.compareTo(h) < 0){
                h_point += 3;
            }
            else{
                t_point += 1;
                h_point += 1;
            }
        }
        System.out.println(t_point + " " + h_point);
    }
}
