#include using namespace std; #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--) #define rep(i, n) for (ll i = 0; i < (n); i++) #define rep1(i, n) for (ll i = 1; i <= (n); i++) #define rrep(i, n) for (ll i = (n)-1; i >= 0; i--) #define pb push_back #define mp make_pair #define fst first #define snd second #define show(x) cout << #x << " = " << x << endl #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define pii pair namespace is_stl_container_impl { template struct is_stl_container : false_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; template struct is_stl_container> : true_type { }; } // namespace is_stl_container_impl //type trait to utilize the implementation type traits as well as decay the type template struct is_stl_container { static constexpr bool const value = is_stl_container_impl::is_stl_container>::value; }; template typename enable_if::value, ostream&>::type operator<<(ostream& os, const T& container) { os << "["; for (const auto& p : container) { os << p << ","; } os << "]"; return os; } template ostream& operator<<(ostream& os, const pair& p) { os << "(" << p.first << "," << p.second << ")"; return os; } using ll = long long; constexpr ll MOD = 1000000007; template constexpr T INF = numeric_limits::inf() / 100; int main() { int y; cin >> y; cout << 2017 - y << endl; return 0; }