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

class Main {

   public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int taro = 0;
      int hanako = 0;
      try {
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         }
         System.out.println(taro + " " + hanako);
      }
      catch (Exception e) {
         System.err.println(e);
      }
   }
} import java.io.*; io.* java class Main {

   public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int taro = 0;
      int hanako = 0;
      try {
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         }
         System.out.println(taro + " " + hanako);
      }
      catch (Exception e) {
         System.err.println(e);
      }
   }
} Main public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int taro = 0;
      int hanako = 0;
      try {
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         }
         System.out.println(taro + " " + hanako);
      }
      catch (Exception e) {
         System.err.println(e);
      }
   } main {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int taro = 0;
      int hanako = 0;
      try {
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         }
         System.out.println(taro + " " + hanako);
      }
      catch (Exception e) {
         System.err.println(e);
      }
   } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int taro = 0; taro 0 int hanako = 0; hanako 0 try {
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         }
         System.out.println(taro + " " + hanako);
      }
      catch (Exception e) {
         System.err.println(e);
      } catch (Exception e) {
         System.err.println(e);
      } Exception e {
         System.err.println(e);
      } System.err.println(e) System.err.println System.err System System.err e {
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         }
         System.out.println(taro + " " + hanako);
      } int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         } {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         } String[] cards = br.readLine().split(" "); cards br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            } cards[0].compareTo(cards[1]) > 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 0 {
               taro += 3;
            } taro += 3 taro 3 if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            } cards[0].compareTo(cards[1]) == 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 0 {
               taro++;
               hanako++;
            } taro++ taro hanako++ hanako if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            } cards[0].compareTo(cards[1]) < 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 0 {
               hanako += 3;
            } hanako += 3 hanako 3 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args
// ITP1_9_C Card Game
import java.io.*;

class Main {

   public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int taro = 0;
      int hanako = 0;
      try {
         int n = Integer.parseInt(br.readLine());
         for (int i = 0; i < n; i++) {

            String[] cards = br.readLine().split(" ");
            if (cards[0].compareTo(cards[1]) > 0) {
               taro += 3;
            } else if (cards[0].compareTo(cards[1]) == 0) {
               taro++;
               hanako++;
            } else if (cards[0].compareTo(cards[1]) < 0) {
               hanako += 3;
            }
         }
         System.out.println(taro + " " + hanako);
      }
      catch (Exception e) {
         System.err.println(e);
      }
   }
}