#include<iostream> #include<cmath> using namespace std; int main(){ int a; cin>>a; if(a<=0) cout<<a%2023; else cout<<(abs(a))%2023; return 0; }