#include<iostream>
#include<conio.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,b;
	cin>>n>>m>>b;
	cout<<n+m-4<<" "<<fixed<<setprecision(0)<<sqrt(b)-1; 
}