a,b = map(int,input().split())
d = b - a # 公差
c = b + d #第三项= 第二项+公差
print(f"{c}")