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