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

public class Main {
	
	public static void main(String[] args) {
		try {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	
	public static void main(String[] args) {
		try {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		try {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		try {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} try {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String number = reader.readLine(); number reader.readLine() reader.readLine reader int n = Integer.parseInt(number); n Integer.parseInt(number) Integer.parseInt Integer number String cards; cards String[] card = new String[2]; card new String[2] 2 int judge; judge int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			} {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			} cards = reader.readLine() cards reader.readLine() reader.readLine reader card = cards.split(" ") card cards.split(" ") cards.split cards " " judge =  card[0].compareTo(card[1]) judge card[0].compareTo(card[1]) card[0].compareTo card[0] card 0 card[1] card 1 if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				} judge > 0 judge 0 {
					taro += 3;
				} taro += 3 taro 3 if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				} judge < 0 judge 0 {
					hanako += 3;
				} hanako += 3 hanako 3 {
					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 reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} public class Main {
	
	public static void main(String[] args) {
		try {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] args) {
		try {

			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			
			String number = reader.readLine();
			int n = Integer.parseInt(number);

			String cards;
			String[] card = new String[2];
			int judge;
			int taro = 0;
			int hanako = 0;
			for (int i = 0; i < n; i++) {
				cards = reader.readLine();
				card = cards.split(" ");
				judge =  card[0].compareTo(card[1]);
				if (judge > 0) {
					taro += 3;
				} else if (judge < 0) {
					hanako += 3;
				} else {
					taro++;
					hanako++;
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}