import java.util.Scanner;
 
class Main {
    Scanner sc = new Scanner(System.in);
 
    public void run() {
        int c=sc.nextInt();
        int c1=0,c2=0;
        for(int i=0;i<c;i++){
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        }
        ln(c1+" "+c2);
    }
 
    public static void main(String[] args) {
        new Main().run();
    }
 
    public static void pr(Object o) {
        System.out.print(o);
    }
 
    public static void ln(Object o) {
        System.out.println(o);
    }
 
    public static void ln() {
        System.out.println();
    }
} import java.util.Scanner; Scanner java.util class Main {
    Scanner sc = new Scanner(System.in);
 
    public void run() {
        int c=sc.nextInt();
        int c1=0,c2=0;
        for(int i=0;i<c;i++){
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        }
        ln(c1+" "+c2);
    }
 
    public static void main(String[] args) {
        new Main().run();
    }
 
    public static void pr(Object o) {
        System.out.print(o);
    }
 
    public static void ln(Object o) {
        System.out.println(o);
    }
 
    public static void ln() {
        System.out.println();
    }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public void run() {
        int c=sc.nextInt();
        int c1=0,c2=0;
        for(int i=0;i<c;i++){
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        }
        ln(c1+" "+c2);
    } run {
        int c=sc.nextInt();
        int c1=0,c2=0;
        for(int i=0;i<c;i++){
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        }
        ln(c1+" "+c2);
    } int c=sc.nextInt(); c sc.nextInt() sc.nextInt sc int c1=0 c1 0 c2=0; c2 0 for(int i=0;i<c;i++){
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        } int i=0; int i=0; i 0 i<c i c i++ i++ i {
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        } {
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        } String s1=sc.next() s1 sc.next() sc.next sc s2=sc.next(); s2 sc.next() sc.next sc if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            } s1.compareTo(s2)>0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
                c1+=3;
            } c1+=3 c1 3 if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            } s1.compareTo(s2)<0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
                c2+=3;
            } c2+=3 c2 3 {
                c1++;c2++;
            } c1++ c1 c2++ c2 ln(c1+" "+c2) ln c1+" "+c2 c1+" "+c2 c1 " " c2 public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public static void pr(Object o) {
        System.out.print(o);
    } pr {
        System.out.print(o);
    } System.out.print(o) System.out.print System.out System System.out o Object o o public static void ln(Object o) {
        System.out.println(o);
    } ln {
        System.out.println(o);
    } System.out.println(o) System.out.println System.out System System.out o Object o o public static void ln() {
        System.out.println();
    } ln {
        System.out.println();
    } System.out.println() System.out.println System.out System System.out
import java.util.Scanner;
 
class Main {
    Scanner sc = new Scanner(System.in);
 
    public void run() {
        int c=sc.nextInt();
        int c1=0,c2=0;
        for(int i=0;i<c;i++){
            String s1=sc.next(),s2=sc.next();
            if(s1.compareTo(s2)>0){
                c1+=3;
            }else if(s1.compareTo(s2)<0){
                c2+=3;
            }else{
                c1++;c2++;
            }
        }
        ln(c1+" "+c2);
    }
 
    public static void main(String[] args) {
        new Main().run();
    }
 
    public static void pr(Object o) {
        System.out.print(o);
    }
 
    public static void ln(Object o) {
        System.out.println(o);
    }
 
    public static void ln() {
        System.out.println();
    }
}
