import java.util.*;
import java.io.*;

public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		int ta = 0, ha = 0;
		for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		}
		System.out.printf("%d %d\n",ta, ha);
	}

}

class NScanner{

	private BufferedReader br;
	private StringTokenizer tok;

	public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	}

	private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	}

	public boolean hasNext(){
		return tok.hasMoreTokens();
	}

	public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	}

	public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	}

	public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	}

	public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		int ta = 0, ha = 0;
		for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		}
		System.out.printf("%d %d\n",ta, ha);
	}

} Main final static int MOD = 1000000007; MOD 1000000007 final static int INF = 1000000000; INF 1000000000 public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		int ta = 0, ha = 0;
		for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		}
		System.out.printf("%d %d\n",ta, ha);
	} main {
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		int ta = 0, ha = 0;
		for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		}
		System.out.printf("%d %d\n",ta, ha);
	} NScanner sc = new NScanner(System.in); sc new NScanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ta = 0 ta 0 ha = 0; ha 0 for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		} int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		} {
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		} String TA = sc.next(); TA sc.next() sc.next sc String HA = sc.next(); HA sc.next() sc.next sc int res = TA.compareTo(HA); res TA.compareTo(HA) TA.compareTo TA HA if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3; res > 0 res 0 ta += 3 ta 3 if(res == 0){
				++ta; ++ha;
			}else ha += 3; res == 0 res 0 {
				++ta; ++ha;
			} ++ta ta ++ha ha ha += 3 ha 3 System.out.printf("%d %d\n",ta, ha) System.out.printf System.out System System.out "%d %d\n" ta ha String[] args args class NScanner{

	private BufferedReader br;
	private StringTokenizer tok;

	public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	}

	private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	}

	public boolean hasNext(){
		return tok.hasMoreTokens();
	}

	public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	}

	public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	}

	public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	}

	public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	}
} NScanner private BufferedReader br; br private StringTokenizer tok; tok public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	} NScanner {
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	} br = new BufferedReader(new InputStreamReader(is)) br new BufferedReader(new InputStreamReader(is)) getLine() getLine InputStream is is private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	} getLine {
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	} while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		} tok == null || !hasNext() tok == null tok null !hasNext() hasNext() hasNext {
			tok = new StringTokenizer(br.readLine());
		} tok = new StringTokenizer(br.readLine()) tok new StringTokenizer(br.readLine()) public boolean hasNext(){
		return tok.hasMoreTokens();
	} hasNext {
		return tok.hasMoreTokens();
	} return tok.hasMoreTokens(); tok.hasMoreTokens() tok.hasMoreTokens tok public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	} next {
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	} if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		} hasNext() hasNext {
			return tok.nextToken();
		} return tok.nextToken(); tok.nextToken() tok.nextToken tok {
			getLine();
			return tok.nextToken();
		} getLine() getLine return tok.nextToken(); tok.nextToken() tok.nextToken tok public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	} nextInt {
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	} if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		} hasNext() hasNext {
			return Integer.parseInt(tok.nextToken());
		} return Integer.parseInt(tok.nextToken()); Integer.parseInt(tok.nextToken()) Integer.parseInt Integer tok.nextToken() tok.nextToken tok {
			getLine();
			return Integer.parseInt(tok.nextToken());
		} getLine() getLine return Integer.parseInt(tok.nextToken()); Integer.parseInt(tok.nextToken()) Integer.parseInt Integer tok.nextToken() tok.nextToken tok public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	} nextLong {
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	} if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		} hasNext() hasNext {
			return Long.parseLong(tok.nextToken());
		} return Long.parseLong(tok.nextToken()); Long.parseLong(tok.nextToken()) Long.parseLong Long tok.nextToken() tok.nextToken tok {
			getLine();
			return Long.parseLong(tok.nextToken());
		} getLine() getLine return Long.parseLong(tok.nextToken()); Long.parseLong(tok.nextToken()) Long.parseLong Long tok.nextToken() tok.nextToken tok public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	} nextDouble {
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	} if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		} hasNext() hasNext {
			return Double.parseDouble(tok.nextToken());
		} return Double.parseDouble(tok.nextToken()); Double.parseDouble(tok.nextToken()) Double.parseDouble Double tok.nextToken() tok.nextToken tok {
			getLine();
			return Double.parseDouble(tok.nextToken());
		} getLine() getLine return Double.parseDouble(tok.nextToken()); Double.parseDouble(tok.nextToken()) Double.parseDouble Double tok.nextToken() tok.nextToken tok public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		int ta = 0, ha = 0;
		for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		}
		System.out.printf("%d %d\n",ta, ha);
	}

} public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		int ta = 0, ha = 0;
		for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		}
		System.out.printf("%d %d\n",ta, ha);
	}

} Main
import java.util.*;
import java.io.*;

public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		int ta = 0, ha = 0;
		for(int i = 0; i < n; ++i){
			String TA = sc.next();
			String HA = sc.next();
			int res = TA.compareTo(HA);
			if(res > 0) ta += 3;
			else if(res == 0){
				++ta; ++ha;
			}else ha += 3;
		}
		System.out.printf("%d %d\n",ta, ha);
	}

}

class NScanner{

	private BufferedReader br;
	private StringTokenizer tok;

	public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	}

	private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	}

	public boolean hasNext(){
		return tok.hasMoreTokens();
	}

	public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	}

	public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	}

	public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	}

	public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	}
}
