public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    String ts, hs;
    int n, tm, hm, tsum, hsum;
    char[] tc, hc;
    int i, j;

    n = sc.nextInt();
    tsum = 0;
    hsum = 0;

    for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    }

    System.out.println(tsum + " " + hsum);

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    String ts, hs;
    int n, tm, hm, tsum, hsum;
    char[] tc, hc;
    int i, j;

    n = sc.nextInt();
    tsum = 0;
    hsum = 0;

    for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    }

    System.out.println(tsum + " " + hsum);

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} Main public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    String ts, hs;
    int n, tm, hm, tsum, hsum;
    char[] tc, hc;
    int i, j;

    n = sc.nextInt();
    tsum = 0;
    hsum = 0;

    for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    }

    System.out.println(tsum + " " + hsum);

    sc.close();
  } run {
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    String ts, hs;
    int n, tm, hm, tsum, hsum;
    char[] tc, hc;
    int i, j;

    n = sc.nextInt();
    tsum = 0;
    hsum = 0;

    for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    }

    System.out.println(tsum + " " + hsum);

    sc.close();
  } java.util.Scanner sc = new java.util.Scanner(in); sc new java.util.Scanner(in) String ts ts hs; hs int n n tm tm hm hm tsum tsum hsum; hsum char[] tc tc hc; hc int i i j; j n = sc.nextInt() n sc.nextInt() sc.nextInt sc tsum = 0 tsum 0 hsum = 0 hsum 0 for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    } i = 0; i = 0 i 0 i < n i n i++ i++ i {
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    } {
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    } ts = sc.next() ts sc.next() sc.next sc hs = sc.next() hs sc.next() sc.next sc if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      } ts.equals(hs) ts.equals ts hs {
        tsum++;
        hsum++;
      } tsum++ tsum hsum++ hsum {
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      } tm = ts.length() tm ts.length() ts.length ts hm = hs.length() hm hs.length() hs.length hs tc = new char[tm] tc new char[tm] tm hc = new char[hm] hc new char[hm] hm for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        } j = 0; j = 0 j 0 j < tm j tm j++ j++ j {
          tc[j] = ts.charAt(j);
        } {
          tc[j] = ts.charAt(j);
        } tc[j] = ts.charAt(j) tc[j] tc j ts.charAt(j) ts.charAt ts j for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        } j = 0; j = 0 j 0 j < hm j hm j++ j++ j {
          hc[j] = hs.charAt(j);
        } {
          hc[j] = hs.charAt(j);
        } hc[j] = hs.charAt(j) hc[j] hc j hs.charAt(j) hs.charAt hs j if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        } tm >= hm tm hm {
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        } for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          } j = 0; j = 0 j 0 j < hm j hm j++ j++ j {
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          } {
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          } if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            } tc[j] > hc[j] tc[j] tc j hc[j] hc j {
              tsum += 3;
              break;
            } tsum += 3 tsum 3 break; if(hc[j] > tc[j]){
              hsum += 3;
              break;
            } hc[j] > tc[j] hc[j] hc j tc[j] tc j {
              hsum += 3;
              break;
            } hsum += 3 hsum 3 break; if(j + 1 == hm){
              tsum += 3;
            } j + 1 == hm j + 1 j 1 hm {
              tsum += 3;
            } tsum += 3 tsum 3 {
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        } for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          } j = 0; j = 0 j 0 j < tm j tm j++ j++ j {
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          } {
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          } if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            } tc[j] > hc[j] tc[j] tc j hc[j] hc j {
              tsum += 3;
              break;
            } tsum += 3 tsum 3 break; if(hc[j] > tc[j]){
              hsum += 3;
              break;
            } hc[j] > tc[j] hc[j] hc j tc[j] tc j {
              hsum += 3;
              break;
            } hsum += 3 hsum 3 break; if(j + 1 == tm){
              hsum += 3;
            } j + 1 == tm j + 1 j 1 tm {
              hsum += 3;
            } hsum += 3 hsum 3 System.out.println(tsum + " " + hsum) System.out.println System.out System System.out tsum + " " + hsum tsum + " " + hsum tsum " " hsum sc.close() sc.close sc java.io.InputStream in in java.io.PrintStream out out public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  } main {
    (new Main()).run(System.in, System.out);
  } (new Main()).run(System.in, System.out) (new Main()).run (new Main()) System.in System System.in System.out System System.out String[] args args public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    String ts, hs;
    int n, tm, hm, tsum, hsum;
    char[] tc, hc;
    int i, j;

    n = sc.nextInt();
    tsum = 0;
    hsum = 0;

    for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    }

    System.out.println(tsum + " " + hsum);

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    String ts, hs;
    int n, tm, hm, tsum, hsum;
    char[] tc, hc;
    int i, j;

    n = sc.nextInt();
    tsum = 0;
    hsum = 0;

    for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    }

    System.out.println(tsum + " " + hsum);

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
} Main
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    String ts, hs;
    int n, tm, hm, tsum, hsum;
    char[] tc, hc;
    int i, j;

    n = sc.nextInt();
    tsum = 0;
    hsum = 0;

    for(i = 0;i < n;i++){
      ts = sc.next();
      hs = sc.next();
      if(ts.equals(hs)){
        tsum++;
        hsum++;
      }else{
        tm = ts.length();
        hm = hs.length();
        tc = new char[tm];
        hc = new char[hm];
        for(j = 0;j < tm;j++){
          tc[j] = ts.charAt(j);
        }
        for(j = 0;j < hm;j++){
          hc[j] = hs.charAt(j);
        }

        if(tm >= hm){
          for(j = 0;j < hm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == hm){
              tsum += 3;
            }
          }
        }else{
          for(j = 0;j < tm;j++){
            if(tc[j] > hc[j]){
              tsum += 3;
              break;
            }else if(hc[j] > tc[j]){
              hsum += 3;
              break;
            }
            if(j + 1 == tm){
              hsum += 3;
            }
          }
        }
      }
    }

    System.out.println(tsum + " " + hsum);

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}