#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int a;
while(scanf("%d",&a)!=EOF){
int MinNumber=0;
int MaxNumber=0;
if(a%2==0){ //总脚数为偶数,该问题才有解,无解情况不用考虑解情况
MinNumber=a/4+(a%4)/2; //先处以4,余数用鸡来代替
MaxNumber=a/2;
}
printf("%d %d",MinNumber,MaxNumber);
}
return 0;
}