# https://open.kattis.com/problems/r2
# CPU time limit: 1s
# Difficulty: 1.3 Easy

# 41 chars (Top 10 is 25..38 my Ruby program is at place 8 with 34 chars)
r,s=map(int,input().split())
print(s*2-r)

