#include <stdio.h>

int largest_prime_factor(int n);

int main() {
	int n;
	while (scanf("%d", &n) > 0) 
    printf("%d\n", largest_prime_factor(n));
	return 0;
}
