/* ITP1_9_C */
import java.io.*;

class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());
      int taro = 0;
      int hanaco = 0;

      for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      }
      sb.append(taro).append(" ").append(hanaco);
      System.out.println(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  }
} import java.io.*; io.* java class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());
      int taro = 0;
      int hanaco = 0;

      for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      }
      sb.append(taro).append(" ").append(hanaco);
      System.out.println(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  }
} Main public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());
      int taro = 0;
      int hanaco = 0;

      for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      }
      sb.append(taro).append(" ").append(hanaco);
      System.out.println(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  } main {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());
      int taro = 0;
      int hanaco = 0;

      for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      }
      sb.append(taro).append(" ").append(hanaco);
      System.out.println(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  } try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());
      int taro = 0;
      int hanaco = 0;

      for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      }
      sb.append(taro).append(" ").append(hanaco);
      System.out.println(sb);
    }catch(Exception e){
      System.out.println(e);
    } catch(Exception e){
      System.out.println(e);
    } Exception e {
      System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());
      int taro = 0;
      int hanaco = 0;

      for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      }
      sb.append(taro).append(" ").append(hanaco);
      System.out.println(sb);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int taro = 0; taro 0 int hanaco = 0; hanaco 0 for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      } {
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      } String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " String taro_card = str[0]; taro_card str[0] str 0 String hanaco_card = str[1]; hanaco_card str[1] str 1 if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        } taro_card.compareTo(hanaco_card) > 0 taro_card.compareTo(hanaco_card) taro_card.compareTo taro_card hanaco_card 0 taro += 3 taro 3 if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        } taro_card.compareTo(hanaco_card) < 0 taro_card.compareTo(hanaco_card) taro_card.compareTo taro_card hanaco_card 0 hanaco += 3 hanaco 3 if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        } taro_card.equals(hanaco_card) taro_card.equals taro_card hanaco_card {
          taro++;
          hanaco++;
        } taro++ taro hanaco++ hanaco sb.append(taro).append(" ").append(hanaco) sb.append(taro).append(" ").append sb.append(taro).append(" ") sb.append(taro).append sb.append(taro) sb.append sb taro " " hanaco System.out.println(sb) System.out.println System.out System System.out sb String[] args args
/* ITP1_9_C */
import java.io.*;

class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      int n = Integer.parseInt(br.readLine());
      int taro = 0;
      int hanaco = 0;

      for(int i = 0; i < n; i++){
        String[] str = br.readLine().split(" ");
        String taro_card = str[0];
        String hanaco_card = str[1];

        if(taro_card.compareTo(hanaco_card) > 0) taro += 3;
        else if(taro_card.compareTo(hanaco_card) < 0 ) hanaco += 3;
        else if(taro_card.equals(hanaco_card)){
          taro++;
          hanaco++;
        }
      }
      sb.append(taro).append(" ").append(hanaco);
      System.out.println(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  }
}