public static void main(String[]args)
	{
		long n = 600851475143L;
		long largestPrime = 0;
		for (long i = 2; i <= n; i++) 
		{ 
			if (n % i == 0) 
			{ 
				if(largestPrime < i) largestPrime = i;
				n /= i; 
				i--; 
			}
		}
		System.out.println(largestPrime);
	}