import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;

public class Main{


  public static void main(String[] args){
    int num_turn; //ターン数
    List<String> taro_c = new ArrayList<String>();
    List<String> hanako_c = new ArrayList<String>();

    int taro_p=0;
    int hanako_p=0;


    Scanner scan = new Scanner(System.in);
    num_turn = scan.nextInt();

    for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    }

    System.out.println(taro_p + " " + hanako_p);


  }

}
 import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main{


  public static void main(String[] args){
    int num_turn; //ターン数
    List<String> taro_c = new ArrayList<String>();
    List<String> hanako_c = new ArrayList<String>();

    int taro_p=0;
    int hanako_p=0;


    Scanner scan = new Scanner(System.in);
    num_turn = scan.nextInt();

    for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    }

    System.out.println(taro_p + " " + hanako_p);


  }

} Main public static void main(String[] args){
    int num_turn; //ターン数
    List<String> taro_c = new ArrayList<String>();
    List<String> hanako_c = new ArrayList<String>();

    int taro_p=0;
    int hanako_p=0;


    Scanner scan = new Scanner(System.in);
    num_turn = scan.nextInt();

    for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    }

    System.out.println(taro_p + " " + hanako_p);


  } main {
    int num_turn; //ターン数
    List<String> taro_c = new ArrayList<String>();
    List<String> hanako_c = new ArrayList<String>();

    int taro_p=0;
    int hanako_p=0;


    Scanner scan = new Scanner(System.in);
    num_turn = scan.nextInt();

    for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    }

    System.out.println(taro_p + " " + hanako_p);


  } int num_turn; num_turn List<String> taro_c = new ArrayList<String>(); taro_c new ArrayList<String>() List<String> hanako_c = new ArrayList<String>(); hanako_c new ArrayList<String>() int taro_p=0; taro_p 0 int hanako_p=0; hanako_p 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) num_turn = scan.nextInt() num_turn scan.nextInt() scan.nextInt scan for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    } int i = 0; int i = 0; i 0 i < num_turn i num_turn i++ i++ i {
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    } {
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    } String taro_w = scan.next(); taro_w scan.next() scan.next scan taro_c.add(taro_w) taro_c.add taro_c taro_w String hanako_w = scan.next(); hanako_w scan.next() scan.next scan hanako_c.add(hanako_w) hanako_c.add hanako_c hanako_w int judge = taro_w.compareTo(hanako_w); judge taro_w.compareTo(hanako_w) taro_w.compareTo taro_w hanako_w if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3; judge >= 1 judge 1 taro_p += 3 taro_p 3 if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3; judge == 0 judge 0 {taro_p += 1; hanako_p += 1;} taro_p += 1 taro_p 1 hanako_p += 1 hanako_p 1 if( judge <= -1) hanako_p += 3; judge <= -1 judge -1 1 hanako_p += 3 hanako_p 3 judge=0 judge 0 System.out.println(taro_p + " " + hanako_p) System.out.println System.out System System.out taro_p + " " + hanako_p taro_p + " " + hanako_p taro_p " " hanako_p String[] args args public class Main{


  public static void main(String[] args){
    int num_turn; //ターン数
    List<String> taro_c = new ArrayList<String>();
    List<String> hanako_c = new ArrayList<String>();

    int taro_p=0;
    int hanako_p=0;


    Scanner scan = new Scanner(System.in);
    num_turn = scan.nextInt();

    for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    }

    System.out.println(taro_p + " " + hanako_p);


  }

} public class Main{


  public static void main(String[] args){
    int num_turn; //ターン数
    List<String> taro_c = new ArrayList<String>();
    List<String> hanako_c = new ArrayList<String>();

    int taro_p=0;
    int hanako_p=0;


    Scanner scan = new Scanner(System.in);
    num_turn = scan.nextInt();

    for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    }

    System.out.println(taro_p + " " + hanako_p);


  }

} Main
import java.util.List;
import java.util.ArrayList;
import java.util.Scanner;

public class Main{


  public static void main(String[] args){
    int num_turn; //ターン数
    List<String> taro_c = new ArrayList<String>();
    List<String> hanako_c = new ArrayList<String>();

    int taro_p=0;
    int hanako_p=0;


    Scanner scan = new Scanner(System.in);
    num_turn = scan.nextInt();

    for(int i = 0; i < num_turn; i++){
      String taro_w = scan.next();
      taro_c.add(taro_w);
      String hanako_w = scan.next();
      hanako_c.add(hanako_w);

      int judge = taro_w.compareTo(hanako_w);
      //太郎があとなら+3,
      if( judge >= 1 ) taro_p += 3;
      else if( judge == 0 ) {taro_p += 1; hanako_p += 1;}
      else if( judge <= -1) hanako_p += 3;

      judge=0;
    }

    System.out.println(taro_p + " " + hanako_p);


  }

}

