import java.util.*;
public class Main {
   public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.nextLine());
      String sTaro;
      String sHanako;
      int iTaro = 0;
      int iHanako = 0;
      
      for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      }  
      
      System.out.println(iTaro + " " + iHanako);    
         
   }//main
      
}//class import java.util.*; util.* java public class Main {
   public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.nextLine());
      String sTaro;
      String sHanako;
      int iTaro = 0;
      int iHanako = 0;
      
      for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      }  
      
      System.out.println(iTaro + " " + iHanako);    
         
   }//main
      
}//class Main public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.nextLine());
      String sTaro;
      String sHanako;
      int iTaro = 0;
      int iHanako = 0;
      
      for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      }  
      
      System.out.println(iTaro + " " + iHanako);    
         
   }//main main {
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.nextLine());
      String sTaro;
      String sHanako;
      int iTaro = 0;
      int iHanako = 0;
      
      for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      }  
      
      System.out.println(iTaro + " " + iHanako);    
         
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc String sTaro; sTaro String sHanako; sHanako int iTaro = 0; iTaro 0 int iHanako = 0; iHanako 0 for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      } {
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      } sTaro = sc.next() sTaro sc.next() sc.next sc sHanako = sc.next() sHanako sc.next() sc.next sc if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         } sTaro.compareTo(sHanako) < 0 sTaro.compareTo(sHanako) sTaro.compareTo sTaro sHanako 0 {
            iHanako += 3;
         } iHanako += 3 iHanako 3 if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         } sTaro.compareTo(sHanako) > 0 sTaro.compareTo(sHanako) sTaro.compareTo sTaro sHanako 0 {
            iTaro += 3;
         } iTaro += 3 iTaro 3 {
            iTaro ++;
            iHanako ++;
         } iTaro ++ iTaro iHanako ++ iHanako System.out.println(iTaro + " " + iHanako) System.out.println System.out System System.out iTaro + " " + iHanako iTaro + " " + iHanako iTaro " " iHanako String args[] args public class Main {
   public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.nextLine());
      String sTaro;
      String sHanako;
      int iTaro = 0;
      int iHanako = 0;
      
      for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      }  
      
      System.out.println(iTaro + " " + iHanako);    
         
   }//main
      
}//class public class Main {
   public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.nextLine());
      String sTaro;
      String sHanako;
      int iTaro = 0;
      int iHanako = 0;
      
      for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      }  
      
      System.out.println(iTaro + " " + iHanako);    
         
   }//main
      
}//class Main
import java.util.*;
public class Main {
   public static void main(String args[]){
      Scanner sc = new Scanner(System.in);
      int n = Integer.parseInt(sc.nextLine());
      String sTaro;
      String sHanako;
      int iTaro = 0;
      int iHanako = 0;
      
      for(int i = 0; i < n; i++){
         sTaro = sc.next();
         sHanako = sc.next();
         
         if(sTaro.compareTo(sHanako) < 0){
            iHanako += 3;
         }else if(sTaro.compareTo(sHanako) > 0){
            iTaro += 3;
         }else{
            iTaro ++;
            iHanako ++;
         }
      }  
      
      System.out.println(iTaro + " " + iHanako);    
         
   }//main
      
}//class
