#include <iostream>
#include <math.h>
using namespace std;
int main () {
int n,m,c;
cin >> n;
m=n%100;
c=m%20;
if (m>65 && m<=99) {
cout << ((n/100+1)*100);
}
else
if (c>15 && c<=19) {
cout << ((n/100)*100)+(((n/10%10)/2)*30)+30;
}
else
cout << ((n/100)*100)+((((n/10%10)/2)*30)+(((n%10)+((n/10%10)%2)*10))*2);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWF0aC5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4gKCkgewogICAgaW50IG4sbSxjOwogICAgY2luID4+IG47CiAgICBtPW4lMTAwOwogICAgYz1tJTIwOwogICAgaWYgKG0+NjUgJiYgbTw9OTkpIHsKICAgICAgICBjb3V0IDw8ICgobi8xMDArMSkqMTAwKTsKICAgIH0KICAgIGVsc2UKICAgICAgICBpZiAoYz4xNSAmJiBjPD0xOSkgewogICAgICAgICAgICBjb3V0IDw8ICgobi8xMDApKjEwMCkrKCgobi8xMCUxMCkvMikqMzApKzMwOwogICAgfQogICAgICAgIGVsc2UKICAgICAgICAgICAgY291dCA8PCAoKG4vMTAwKSoxMDApKygoKChuLzEwJTEwKS8yKSozMCkrKCgobiUxMCkrKChuLzEwJTEwKSUyKSoxMCkpKjIpOwogICAgcmV0dXJuIDA7Cn0=