import java.util.Scanner;

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

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

        int taroPnt = 0;
        int hanakoPnt = 0;
        for(int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        }
        System.out.println(taroPnt + " " + hanakoPnt);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int taroPnt = 0;
        int hanakoPnt = 0;
        for(int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        }
        System.out.println(taroPnt + " " + hanakoPnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int taroPnt = 0;
        int hanakoPnt = 0;
        for(int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        }
        System.out.println(taroPnt + " " + hanakoPnt);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int taroPnt = 0; taroPnt 0 int hanakoPnt = 0; hanakoPnt 0 for(int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        } {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        } String taro = sc.next(); taro sc.next() sc.next sc String hanako = sc.next(); hanako sc.next() sc.next sc if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            } taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                taroPnt += 3;
            } taroPnt += 3 taroPnt 3 if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            } taro.compareTo(hanako) == 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                taroPnt += 1;
                hanakoPnt += 1;
            } taroPnt += 1 taroPnt 1 hanakoPnt += 1 hanakoPnt 1 {
                hanakoPnt += 3;
            } hanakoPnt += 3 hanakoPnt 3 System.out.println(taroPnt + " " + hanakoPnt) System.out.println System.out System System.out taroPnt + " " + hanakoPnt taroPnt + " " + hanakoPnt taroPnt " " hanakoPnt String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int taroPnt = 0;
        int hanakoPnt = 0;
        for(int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        }
        System.out.println(taroPnt + " " + hanakoPnt);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int taroPnt = 0;
        int hanakoPnt = 0;
        for(int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        }
        System.out.println(taroPnt + " " + hanakoPnt);
    }
} Main
import java.util.Scanner;

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

        int taroPnt = 0;
        int hanakoPnt = 0;
        for(int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0) {
                taroPnt += 3;
            } else if(taro.compareTo(hanako) == 0) {
                taroPnt += 1;
                hanakoPnt += 1;
            } else {
                hanakoPnt += 3;
            }
        }
        System.out.println(taroPnt + " " + hanakoPnt);
    }
}

