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.
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class SuffixArray {
	private static InputStream stream;
	private static byte[] buf = new byte[1024];
	private static int curChar;
	private static int numChars;
	private static SpaceCharFilter filter;
	private static PrintWriter pw;
	private static long max = Long.MIN_VALUE;
	private static int mod = 1000000000 + 7;
	private static boolean flag=false;
	private static void soln() {
		int n=nextInt();
		int max=2*(n/7);
		int tmp=n%7;
		if(tmp>=2)
			max+=2;
		else
			max+=tmp;
		int min=0;
		if(n>=5){
			min=2*((n-5)/7);
			tmp=(n-5)%7;
			if(tmp>=2)
				min+=2;
			else
				min+=tmp;
		}
		pw.println(min+" "+max);
	}
	private static int cnt=0;
	private static void DFS(int cur,int prev,int[] dfs,LinkedList<Integer>[] l,int[] st,int[] et,int[] depth){
		dfs[cnt]=cur;
		st[cur]=cnt;
		cnt++;
		if(prev==-1)
			depth[cur]=0;
		else
			depth[cur]=depth[prev]+1;
		Iterator<Integer> i=l[cur].listIterator();
		while(i.hasNext()){
			int x=i.next();
			if(x!=prev)
				DFS(x,cur,dfs,l,st,et,depth);
		}
		dfs[cnt]=cur;
		et[cur]=cnt;
		cnt++;
	}
public static class Segment {
	private int[] tree;
	private int size;
	private int n;
	//private int[] base;
	private class node{
		private int a;
		private int b;
		private int c;
		public node(int x,int y,int z){
			a=x;
			b=y;
			c=z;
		}
	}
	public Segment(int n){
		//this.base=arr;
		int x = (int) (Math.ceil(Math.log(n) / Math.log(2)));
        size = 2 * (int) Math.pow(2, x) - 1;
		tree=new int[size];
		this.n=n;
		//build(0,0,n-1);
	}
	private void build(int id,int l,int r){
		//pw.println(1);
		if(r==l){
			tree[id]=0;
			return;
		}
		int mid=l+(r-l)/2;
		//System.out.println(2*id+1+" "+l+" "+mid);
		build(2*id+1,l,mid);
		//System.out.println(2*id+2+" "+(mid+1)+" "+r);
		build(2*id+2,mid+1,r);
		tree[id]=tree[2*id+1]+tree[2*id+2];
	}
	public int query(int l,int r){
		return queryUtil(l,r,0,0,n-1);
	}
	private int queryUtil(int x,int y,int id,int l,int r){
		if(l>y || x>r) 
			return 0;
		if(x <= l && r<=y)
			return tree[id];
		int mid=l+(r-l)/2;
		return queryUtil(x,y,2*id+1,l,mid)+queryUtil(x,y,2*id+2,mid+1,r);
	}
	/*private void cnt(int id,int l,int r,HashSet<Integer> set){
		if(tree[id]!=0){
			set.add(tree[id]);
			return;
		}
		if(r==l)
			return;
		int mid=l+(r-l)/2;
		cnt(2*id+1,l,mid,set);
		cnt(2*id+2,mid+1,r,set);
	}*/
	/*public void update(int x,int y,int id,int l,int r){
		if(x>r || l>y)
			return;
		if(x<=l && r<=y){
			tree[id]=1;
			return;
		}
		int mid=l+(r-l)/2;
		shift(id);
		update(x,y,2*id+1,l,mid);
		update(x,y,2*id+2,mid+1,r);
		tree[id]=tree[2*id+1]+tree[2*id+2];
	}*/
	public void update(int l,int r,int i,int id){
		if(i<l || i>r)
			return;
		if(l==r)
			tree[id]=1;
		else{
			int mid=l+(r-l)/2;
			update(l,mid,i,2*id+1);
			update(mid+1,r,i,2*id+2);
			tree[id]=tree[2*id+1]+tree[2*id+2];
		}
	}
	private void shift(int id){
		if(tree[id]!=0){
			tree[2*id+1]=tree[2*id+2]=tree[id];
		}
		tree[id]=0;
	}
}
	public static class Suffix implements Comparable<Suffix>{
		int index;
		int[] rank=new int[2];
		@Override
		public int compareTo(Suffix arg0){
			return (this.rank[0]==arg0.rank[0])?(this.rank[1]<arg0.rank[1]?-1:1):(this.rank[0]<arg0.rank[0]?-1:1);
		}	
	}
	private static int[] buildSuffix(String s,int n){
		Suffix[] arr=new Suffix[n];
		for(int i=0;i<n;i++)
			arr[i]=new Suffix();
		for(int i=0;i<n;i++){
			arr[i].index=i;
			arr[i].rank[0]=s.charAt(i)-'a';
			arr[i].rank[1]=((i+1)<n)?(s.charAt(i+1)-'a'):-1;
		}
		Arrays.sort(arr);
		//for(int i=0;i<n;i++)
			//System.out.print(arr[i].index);
		int[] ind=new int[n];
		for(int k=4;k<2*n;k=k*2){
			int rank=0;
			int p_rank=arr[0].rank[0];
			arr[0].rank[0]=rank;
			ind[arr[0].index]=0;
			for(int i=1;i<n;i++){
				if (arr[i].rank[0] == p_rank && arr[i].rank[1] == arr[i-1].rank[1]) {
	                p_rank = arr[i].rank[0];
	                arr[i].rank[0] = rank;
	            }
	            else{
	                p_rank = arr[i].rank[0];
	                arr[i].rank[0] = ++rank;
	            }
	            ind[arr[i].index] = i;
	        }
			for(int i=0;i<n;i++){
				int n_index=arr[i].index + k/2;
				arr[i].rank[1]=(n_index<n)?arr[ind[n_index]].rank[0] : -1;
			}
			Arrays.sort(arr);
		}
		int[] suffixArr=new int[n];
		for(int i=0;i<n;i++)
			suffixArr[i]=arr[i].index;
		return suffixArr;
	}
	private static long pow(long a, long b, long c) {
		if (b == 0)
			return 1;
		long p = pow(a, b / 2, c);
		p = (p * p) % c;
		return (b % 2 == 0) ? p : (a * p) % c;
	}
	
	private static class Pair implements Comparable<Pair> {
		int x;
		int y;
		int z;
		public Pair(int a,int b,int c) {
			x=a;y=b;z=c;
		}
		@Override
		public int compareTo(Pair arg0) {
			return (y!=arg0.y)?(arg0.y-y):(arg0.x-x);
		}
	}

	private static long gcd(long a, long res1) {
		if (res1 == 0)
			return a;
		return gcd(res1, a % res1);
	}

	private static long max(long a, long b) {
		if (a > b)
			return a;
		return b;
	}

	private static long min(long a, long b) {
		if (a < b)
			return a;
		return b;
	}

	public static void main(String[] args) throws Exception {
		InputReader(System.in);
		pw = new PrintWriter(System.out);
		soln();
		pw.close();
	}

	public static void InputReader(InputStream stream1) {
		stream = stream1;
	}

	private static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private static boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

	private static int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	private static int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private static String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	private static int[] nextIntArray(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextInt();
		}
		return arr;
	}

	private static long[] nextLongArray(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextLong();
		}
		return arr;
	}

	private static void pArray(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	private static void pArray(long[] arr) {
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	private static boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}