"use strict"

function main(input) {
  input = input.split(/\n/).map(v => ~~v)
  //
  const ans = input[0] + (input[1] - input[0]) * 2
  // avg * 2 = ( a +b )
  //2017  = 2002 + 2032  / 2
  // 4034 -x  = 2002

  console.log(ans)
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));