import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
public class Main {
	public static final int TARO=0;
	public static final int HANAKO=1;
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        int[] point = new int[2];
        for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        }
        out.printf("%d %d\n",point[TARO], point[HANAKO]);
        out.flush();
    }
  
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
	public static final int TARO=0;
	public static final int HANAKO=1;
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        int[] point = new int[2];
        for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        }
        out.printf("%d %d\n",point[TARO], point[HANAKO]);
        out.flush();
    }
  
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main public static final int TARO=0; TARO 0 public static final int HANAKO=1; HANAKO 1 public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        int[] point = new int[2];
        for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        }
        out.printf("%d %d\n",point[TARO], point[HANAKO]);
        out.flush();
    } exec {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        int[] point = new int[2];
        for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        }
        out.printf("%d %d\n",point[TARO], point[HANAKO]);
        out.flush();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] point = new int[2]; point new int[2] 2 for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        } {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        } String[] cards = br.readLine().split(" "); cards br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int cmp = cards[TARO].compareTo(cards[HANAKO]); cmp cards[TARO].compareTo(cards[HANAKO]) cards[TARO].compareTo cards[TARO] cards TARO cards[HANAKO] cards HANAKO if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	} cmp < 0 cmp 0 {
        		point[HANAKO] += 3;
        	} point[HANAKO] += 3 point[HANAKO] point HANAKO 3 if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	} 0 < cmp 0 cmp {
        		point[TARO] += 3;
        	} point[TARO] += 3 point[TARO] point TARO 3 {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	} point[TARO] ++ point[TARO] point TARO point[HANAKO] ++ point[HANAKO] point HANAKO out.printf("%d %d\n",point[TARO], point[HANAKO]) out.printf out "%d %d\n" point[TARO] point TARO point[HANAKO] point HANAKO out.flush() out.flush out public static void main(String[] args) throws IOException {
        new Main().exec();
    } main {
        new Main().exec();
    } new Main().exec() new Main().exec new Main() String[] args args public class Main {
	public static final int TARO=0;
	public static final int HANAKO=1;
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        int[] point = new int[2];
        for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        }
        out.printf("%d %d\n",point[TARO], point[HANAKO]);
        out.flush();
    }
  
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} public class Main {
	public static final int TARO=0;
	public static final int HANAKO=1;
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        int[] point = new int[2];
        for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        }
        out.printf("%d %d\n",point[TARO], point[HANAKO]);
        out.flush();
    }
  
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
public class Main {
	public static final int TARO=0;
	public static final int HANAKO=1;
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        int n = Integer.parseInt(br.readLine());
        int[] point = new int[2];
        for(int i=0; i<n; i++) {
        	String[] cards = br.readLine().split(" ");
        	int cmp = cards[TARO].compareTo(cards[HANAKO]);
        	if (cmp < 0){
        		point[HANAKO] += 3;
        	} else if (0 < cmp) {
        		point[TARO] += 3;
        	} else {
        		point[TARO] ++;
        		point[HANAKO] ++;
        	}
        }
        out.printf("%d %d\n",point[TARO], point[HANAKO]);
        out.flush();
    }
  
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
}