#include <iostream>
bool check_result(unsigned int x) {
if(x % 20 == 0
&& x % 19 == 0
&& x % 18 == 0
&& x % 17 == 0
&& x % 16 == 0
&& x % 15 == 0
&& x % 14 == 0
&& x % 13 == 0
&& x % 12 == 0
&& x % 11 == 0) {
return true;
}
else {
return false;
}
}
int main() {
unsigned int n = 4324319;
unsigned int result = 0;
while(n != 0) {
result = 1396755360 - n*323;
if(check_result(result)) {
break;
}
--n;
}
std::cout << result << std::endl;
}