import std.algorithm, std.string, std.range, std.stdio, std.conv; void main() { int y = readln.chomp.to!(int); writeln(2017 - y); }