#include <stdio.h>

unsigned long int prime(unsigned long int n) {
	unsigned long int i;
	for (i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			return 0;
		}
	}
	return n > 1;
}

int main(void) {
	unsigned long int a, d, n, i;
	scanf("%d%d%d", &a, &d, &n);
	if (!a && !d && !n) {
		return 0;
	}
	for (i = 0; i < n; a += d) {
		if (prime(a)) {
			i++;
		}
	}
	a -= d;
	printf("%lu\n", a);
	return 0;
}