import sys r1, s = sys.stdin.readline().split(' ') r1 = int(r1) s = int(s) print(s*2 - r1)