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

    }
} 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 ap=0;
      int bp=0;
      for(int i=0; i<n; i++){
    	  String a=sc.next();
    	  String b=sc.next();
    	  if(a.compareTo(b)>0){
    		  ap+=3;
    	  }else if(a.compareTo(b)==0){
    		  ap++;
    		  bp++;
    	  }else{
    		  bp+=3;
    	  }
      }
      System.out.println(ap+" "+bp);

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

    } main {
		Scanner sc = new Scanner(System.in);
      int n=sc.nextInt();
      int ap=0;
      int bp=0;
      for(int i=0; i<n; i++){
    	  String a=sc.next();
    	  String b=sc.next();
    	  if(a.compareTo(b)>0){
    		  ap+=3;
    	  }else if(a.compareTo(b)==0){
    		  ap++;
    		  bp++;
    	  }else{
    		  bp+=3;
    	  }
      }
      System.out.println(ap+" "+bp);

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

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

    }
} 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 ap=0;
      int bp=0;
      for(int i=0; i<n; i++){
    	  String a=sc.next();
    	  String b=sc.next();
    	  if(a.compareTo(b)>0){
    		  ap+=3;
    	  }else if(a.compareTo(b)==0){
    		  ap++;
    		  bp++;
    	  }else{
    		  bp+=3;
    	  }
      }
      System.out.println(ap+" "+bp);

    }
}
