On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible number of days off per year on Mars.

Input

The first line of the input contains a positive integer n (1 ≤ n ≤ 1 000 000) — the number of days in a year on Mars.

Output

Print two integers — the minimum possible and the maximum possible number of days off per year on Mars.

Examples

Input

14


Output

4 4


Input

2


Output

0 2

Note

In the first sample there are 14 days in a year on Mars, and therefore independently of the day a year starts with there will be exactly 4 days off .

In the second sample there are only 2 days in a year on Mars, and they can both be either work days or days off.

/**
 *
 * @author sarthak
 */

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

public class rnd350_A {

    static class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

    static class P implements Comparable {

        private int x, y;

        public P(int x, int y) {
            this.x = x;
            this.y = y;
        }

        public int hashCode() {
            return (x * 31) ^ y;
        }

        public boolean equals(Object o) {
            if (o instanceof P) {
                P other = (P) o;
                return (x == other.x && y == other.y);
            }
            return false;
        }

        public int compareTo(Object obj) {
            P l = (P) obj;
            if (this.x == l.x) {
                if (this.y == l.y) {
                    return 0;
                }
                return (this.y < l.y) ? -1 : 1;
            }
            return (this.x < l.x) ? -1 : 1;
        }
    }

    public static void main(String[] args) {

        FastScanner s = new FastScanner(System.in);
        StringBuilder op = new StringBuilder();

        int n = s.nextInt();
        if (n <= 7) {
            if (n == 1) {
                System.out.println(0 + " " + 1);
            }
            if (n == 2) {
                System.out.println(0 + " " + 2);
            }
            if (n == 3) {
                System.out.println(0 + " " + 2);
            }
            if (n == 4) {
                System.out.println(0 + " " + 2);
            }
            if (n == 5) {
                System.out.println(0 + " " + 2);
            }
            if (n == 6) {
                System.out.println(1 + " " + 2);
            }
            if (n == 7) {
                System.out.println(2 + " " + 2);
            }
            return;
        }
        int[] a = new int[8];
        int max = 0;
        int min = Integer.MAX_VALUE;
        for (int sd = 1; sd <= 7; sd++) {
            for (int i = sd; i <= 7; i++) {
                a[i]++;
            }
            int st = 1;
            int left = n - (7 - sd + 1);
            while (left > 0) {
                a[st]++;
                st++;
                if (st > 7) {
                    st = st % 7;
                }
                if (st == 0) {
                    st = 7;
                }
                left--;
            }
            max = Math.max(max, a[6] + a[7]);
            min = Math.min(min, a[6] + a[7]);
            Arrays.fill(a, 0);

        }
        System.out.println(min + " " + max);

    }

}
