#include <cstdio>

int main() {
	freopen("hotel.in", "r", stdin);
	freopen("hotel.out", "w", stdout);
	int n;
	scanf("%d", &n);
	switch (n % 3) {
		case 0: {
			printf("%d %d\n", 0, n / 3);
			break;
		}
		case 1: {
			printf("%d %d\n", 2, n / 3 - 1);
			break;
		}
		case 2: {
			printf("%d %d\n", 1, n / 3);
			break;
		}
		default:;
	}
	return 0;
}
