lib C fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64 end class String def to_i64 C.strtoll(self, nil, 10) end end a, b, c, d = read_line.split.map(&.to_i64) if a == c || b == d || (a - c).abs + (b - d).abs <= 3 puts 1 else puts 2 end