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