'''
trivial. not sure why this was in my recommended.
'''
r1, s = [int(x) for x in input().split(' ')]
print(s*2 - r1)

d3284c5514856cd20407bd39eae32dde45885b37
<mask token>

<mask token>
print(s * 2 - r1)

<mask token>
r1, s = [int(x) for x in input().split(' ')]
print(s * 2 - r1)

'''
trivial. not sure why this was in my recommended.
'''
r1, s = [int(x) for x in input().split(' ')]
print(s*2 - r1)
