import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
} Main public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	} main {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	} try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(input.readLine()); n Integer.parseInt(input.readLine()) Integer.parseInt Integer input.readLine() input.readLine input int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			} {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			} final String[] cards = input.readLine().split(" "); cards input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				} 0 < cards[0].compareTo(cards[1]) 0 cards[0].compareTo(cards[1]) cards[0].compareTo cards[0] cards 0 cards[1] cards 1 {
					taro += 3;
				} taro += 3 taro 3 if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				} 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 if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				} 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 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
} public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			int n = Integer.parseInt(input.readLine());
			
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				final String[] cards = input.readLine().split(" ");
				if (0 < cards[0].compareTo(cards[1])) {
					taro += 3;
				} else if (cards[0].compareTo(cards[1]) < 0) {
					hanako += 3;
				} else if (cards[0].compareTo(cards[1]) == 0) {
					taro++;
					hanako++;
				}
			}
			
			System.out.println(taro + " " + hanako);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

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