#include <iostream>
#include <cmath>
using namespace std;

int main() {
	cout << round(543511. / 1000) * 1000; 
	return 0;
}