#include using namespace std; typedef int64_t lint; int main() { lint y; cin>>y; cout<<2017-y<