import java.util.*;

public class Main{
  public static void main(String args[]) {
    Scanner in  = new Scanner(System.in);
    int rnum = in.nextInt();
    int taro = 0, hanako = 0;

    for(int i = 0; i < rnum; i++){
      String p1 = in.next();
      String p2 = in.next();
      if( p1.compareTo(p2) < 0){
        hanako +=3;
      } else if(p1.compareTo(p2) > 0){
        taro += 3;
      } else if(p1.compareTo(p2) == 0){
        taro += 1;
        hanako += 1;
      }
    }

    System.out.println(taro + " " + hanako);
  }
}
 import java.util.*; util.* java public class Main{
  public static void main(String args[]) {
    Scanner in  = new Scanner(System.in);
    int rnum = in.nextInt();
    int taro = 0, hanako = 0;

    for(int i = 0; i < rnum; i++){
      String p1 = in.next();
      String p2 = in.next();
      if( p1.compareTo(p2) < 0){
        hanako +=3;
      } else if(p1.compareTo(p2) > 0){
        taro += 3;
      } else if(p1.compareTo(p2) == 0){
        taro += 1;
        hanako += 1;
      }
    }

    System.out.println(taro + " " + hanako);
  }
} Main public static void main(String args[]) {
    Scanner in  = new Scanner(System.in);
    int rnum = in.nextInt();
    int taro = 0, hanako = 0;

    for(int i = 0; i < rnum; i++){
      String p1 = in.next();
      String p2 = in.next();
      if( p1.compareTo(p2) < 0){
        hanako +=3;
      } else if(p1.compareTo(p2) > 0){
        taro += 3;
      } else if(p1.compareTo(p2) == 0){
        taro += 1;
        hanako += 1;
      }
    }

    System.out.println(taro + " " + hanako);
  } main {
    Scanner in  = new Scanner(System.in);
    int rnum = in.nextInt();
    int taro = 0, hanako = 0;

    for(int i = 0; i < rnum; i++){
      String p1 = in.next();
      String p2 = in.next();
      if( p1.compareTo(p2) < 0){
        hanako +=3;
      } else if(p1.compareTo(p2) > 0){
        taro += 3;
      } else if(p1.compareTo(p2) == 0){
        taro += 1;
        hanako += 1;
      }
    }

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

    for(int i = 0; i < rnum; i++){
      String p1 = in.next();
      String p2 = in.next();
      if( p1.compareTo(p2) < 0){
        hanako +=3;
      } else if(p1.compareTo(p2) > 0){
        taro += 3;
      } else if(p1.compareTo(p2) == 0){
        taro += 1;
        hanako += 1;
      }
    }

    System.out.println(taro + " " + hanako);
  }
} public class Main{
  public static void main(String args[]) {
    Scanner in  = new Scanner(System.in);
    int rnum = in.nextInt();
    int taro = 0, hanako = 0;

    for(int i = 0; i < rnum; i++){
      String p1 = in.next();
      String p2 = in.next();
      if( p1.compareTo(p2) < 0){
        hanako +=3;
      } else if(p1.compareTo(p2) > 0){
        taro += 3;
      } else if(p1.compareTo(p2) == 0){
        taro += 1;
        hanako += 1;
      }
    }

    System.out.println(taro + " " + hanako);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String args[]) {
    Scanner in  = new Scanner(System.in);
    int rnum = in.nextInt();
    int taro = 0, hanako = 0;

    for(int i = 0; i < rnum; i++){
      String p1 = in.next();
      String p2 = in.next();
      if( p1.compareTo(p2) < 0){
        hanako +=3;
      } else if(p1.compareTo(p2) > 0){
        taro += 3;
      } else if(p1.compareTo(p2) == 0){
        taro += 1;
        hanako += 1;
      }
    }

    System.out.println(taro + " " + hanako);
  }
}

