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

class Main {
    public static void main(String[] args) {
        // 사전순 빠른게 승 3점
        // 무승부 1점
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] data;
        int rep, a = 0, b = 0;
        try {
            rep = Integer.parseInt(br.readLine());
            while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            }
            System.out.printf("%d %d\n", a, b);
        } 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 class Main {
    public static void main(String[] args) {
        // 사전순 빠른게 승 3점
        // 무승부 1점
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] data;
        int rep, a = 0, b = 0;
        try {
            rep = Integer.parseInt(br.readLine());
            while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            }
            System.out.printf("%d %d\n", a, b);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
} Main public static void main(String[] args) {
        // 사전순 빠른게 승 3점
        // 무승부 1점
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] data;
        int rep, a = 0, b = 0;
        try {
            rep = Integer.parseInt(br.readLine());
            while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            }
            System.out.printf("%d %d\n", a, b);
        } catch (IOException e) {
            e.printStackTrace();
        }

    } main {
        // 사전순 빠른게 승 3점
        // 무승부 1점
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] data;
        int rep, a = 0, b = 0;
        try {
            rep = Integer.parseInt(br.readLine());
            while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            }
            System.out.printf("%d %d\n", a, b);
        } catch (IOException e) {
            e.printStackTrace();
        }

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] data; data int rep rep a = 0 a 0 b = 0; b 0 try {
            rep = Integer.parseInt(br.readLine());
            while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            }
            System.out.printf("%d %d\n", a, b);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            rep = Integer.parseInt(br.readLine());
            while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            }
            System.out.printf("%d %d\n", a, b);
        } rep = Integer.parseInt(br.readLine()) rep Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            } rep-- > 0 rep-- rep 0 {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            } data = br.readLine().split(" ") data br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3; data[0].compareTo(data[1]) == 0 data[0].compareTo(data[1]) data[0].compareTo data[0] data 0 data[1] data 1 0 {
                    a++;
                    b++;
                } a++ a b++ b if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3; data[0].compareTo(data[1]) >= 1 data[0].compareTo(data[1]) data[0].compareTo data[0] data 0 data[1] data 1 1 a += 3 a 3 b += 3 b 3 System.out.printf("%d %d\n", a, b) System.out.printf System.out System System.out "%d %d\n" a b String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
    public static void main(String[] args) {
        // 사전순 빠른게 승 3점
        // 무승부 1점
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] data;
        int rep, a = 0, b = 0;
        try {
            rep = Integer.parseInt(br.readLine());
            while (rep-- > 0) {
                data = br.readLine().split(" ");
                if (data[0].compareTo(data[1]) == 0) {
                    a++;
                    b++;
                } else if (data[0].compareTo(data[1]) >= 1)
                    a += 3;
                else
                    b += 3;
            }
            System.out.printf("%d %d\n", a, b);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
