import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String b="",g="";
        int bc=0,gc=0;
        for(int i=0;i<n;i++){
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        }
        System.out.println(bc+" "+gc);
        sc.close();
    }
}
     import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String b="",g="";
        int bc=0,gc=0;
        for(int i=0;i<n;i++){
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        }
        System.out.println(bc+" "+gc);
        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String b="",g="";
        int bc=0,gc=0;
        for(int i=0;i<n;i++){
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        }
        System.out.println(bc+" "+gc);
        sc.close();
    } main {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String b="",g="";
        int bc=0,gc=0;
        for(int i=0;i<n;i++){
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        }
        System.out.println(bc+" "+gc);
        sc.close();
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc String b="" b "" g=""; g "" int bc=0 bc 0 gc=0; gc 0 for(int i=0;i<n;i++){
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        } {
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        } b=sc.next() b sc.next() sc.next sc g=sc.next() g sc.next() sc.next sc if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            } b.compareTo(g)>0 b.compareTo(g) b.compareTo b g 0 {
                bc+=3;
            } bc+=3 bc 3 if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            } b.compareTo(g)<0 b.compareTo(g) b.compareTo b g 0 {
                gc+=3;
            } gc+=3 gc 3 {
                bc++;
                gc++;
            } bc++ bc gc++ gc System.out.println(bc+" "+gc) System.out.println System.out System System.out bc+" "+gc bc+" "+gc bc " " gc sc.close() sc.close sc String[] args args
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        String b="",g="";
        int bc=0,gc=0;
        for(int i=0;i<n;i++){
            b=sc.next();
            g=sc.next();
            if(b.compareTo(g)>0){
                bc+=3;
            }else if(b.compareTo(g)<0){
                gc+=3;
            }else{
                bc++;
                gc++;
            }
        }
        System.out.println(bc+" "+gc);
        sc.close();
    }
}
    
