Problem:
 Score : 100 points    Problem Statement Takahashi is a user of a site that hosts programming contests. When a user competes in a contest, the rating of the user (not necessarily an integer) changes according to the performance of the user, as follows:   Let the current rating of the user be a .  Suppose that the performance of the user in the contest is b .  Then, the new rating of the user will be the avarage of a and b .   For example, if a user with rating 1 competes in a contest and gives performance 1000 , his/her new rating will be 500.5 , the average of 1 and 1000 .  Takahashi's current rating is R , and he wants his rating to be exactly G after the next contest. Find the performance required to achieve it.      Constraints  0 \leq R, G \leq 4500  All input values are integers.         Input Input is given from Standard Input in the following format:  R  G       Output Print the performance required to achieve the objective.        Sample Input 1 2002
2017      Sample Output 1 2032  Takahashi's current rating is 2002 . If his performance in the contest is 2032 , his rating will be the average of 2002 and 2032 , which is equal to the desired rating, 2017 .       Sample Input 2 4500
0      Sample Output 2 -4500  Although the current and desired ratings are between 0 and 4500 , the performance of a user can be below 0 .

Solution (Python):
import sys
import math
from fractions import gcd





def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""


 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())


 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


R =  int(sys.stdin.readline())
G =  int(sys.stdin.readline())

print(math.floor((2 * G) - R))

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(G + G - R)

Solution (Python):
R = int(input().strip())
G = int(input().strip())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())

X = G - R
ans = G + X
print(ans)

Solution (Python):
R,G=map(int,open(0));print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
print(-(int(input()) - 2*int(input())))

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r, g = [int(input()) for i in range(2)]
print(r + (g - r) * 2)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
r=int(input())
g=int(input())

print(g+g-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())





print(2 * G - R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
R = int(input())
G = int(input())

res = 2*G-R
print(res)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
def resolve():
    r = int(input())
    g = int(input())
    print(2 * g - r)


if __name__ == "__main__":
    resolve()

Solution (Python):
a = int(input())
b = int(input())
print(b+b-a)

Solution (Python):
R = int(input())
G = int(input())
print(G + G - R)

Solution (Python):
a = int(input())
b = int(input())
c = b - a
print(b+c)

Solution (Python):
R = int(input())
G = int(input())
X = 2 * G - R
print(X)

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    R = int(input())
    G = int(input())

    print(2 * G - R)


if __name__ == "__main__":
    main()

Solution (Python):
a=int(input())
b=int(input())
print(b*2-a)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r =int(input())
g =int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
if 0 <= r <= 4500 and 0 <= g <= 4500:
    print(2 * g - r)
else:
    print('hoge!')

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
R=int(input())
G=int(input())
print(R+2*(G-R))

Solution (Python):
print(( -int(input()) + int(input())*2))

Solution (Python):
r, g = [int(input()) for _ in range(2)]
print(2*g - r)

Solution (Python):
import sys
import  math
import bisect
from statistics import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

r = ni()
g = ni()
print(2 * g - r)

Solution (Python):


r = int(input())
g = int(input())

m = g * 2 - r

print(m)

Solution (Python):
R = int(input())
G = int(input())
print(str(G*2-R))

Solution (Python):
r = int(input())
g = int(input())

print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
print(- int(input()) + 2 * int(input()))

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):
r=float(input())
g=float(input())
print(int(2*g-r))

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
a,b=map(int,open(0));print(2*b-a)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r = int(input())
g = int(input())
print(int(2*g-r))

Solution (Python):
r,g=open(0);print(2*int(g)-int(r))

Solution (Python):
r = int(input())
g = int(input())
print(g*2 - r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
num = [int(input()) for i in range(2)]
print(num[1]*2 - num[0])

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
a = int(input())
g = int(input())

print(g-a+g)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
r = 2*G-R
print(r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r = int(input())
g = int(input())

a = (g-r)*2
ans = r + a 
print(ans)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
print(-int(input())+int(input())*2)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

print((g - r)*2 + r)

Solution (Python):
r, g = [int(input()) for _ in range(2)]
print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
r=int(input())
g=int(input())

print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())

print(G * 2 - R)

Solution (Python):
R, G = map(int, [input() for i in range(2)])
print(G * 2 - R)

Solution (Python):
curr_rating = int(input())
final_rating = int(input())

print(2 * final_rating - curr_rating)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
def main():
    R = int(input())
    G = int(input())
    return 2*G - R
if __name__ == '__main__':
    print(main())

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):

r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):


R = int(input())
G = int(input())

print(G * 2 - R)

Solution (Python):
a = int(input())
b = int(input())

print(2*b-a)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R, G = [int(input()) for _ in range(2)]
print(G * 2 - R)

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
R=int(input())
G=int(input())

print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())

print((G-R)*2+R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
print(-int(input())+int(input())*2)

Solution (Python):
def test():
    r = int(input())
    g = int(input())
    print(2*g-r)


if __name__ == "__main__":
    test()

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r, g = [int(input()) for _ in range(2)]
print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(g*2-r)

Solution (Python):
print(-int(input()) + 2 * int(input()))

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
r=int(input())
g=int(input())

print(r+(g-r)*2)

Solution (Python):
R = int(input())
G = int(input())

ans = 2*G-R
print(ans)

Solution (Python):
R,G=[int(input())for _ in range(2)]
print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R=int(input())
G=int(input())
print(G*2-R)

Solution (Python):
a = int(input())
b = int(input())
print(2*b -a)

Solution (Python):
n,m=(int(input()) for _ in range(2))
print(n+((m-n)*2))

Solution (Python):
r,g=map(int,open(0).read().split())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
R, G = int(input()), int(input())
print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
print(-int(input()) + 2 * int(input()))

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):

r=int(input())
g=int(input())

print(r+2*(g-r))

Solution (Python):
r, g = [int(input()) for _ in range(2)]
print(2*g-r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R,G = map(int,open(0).read().split())
print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R,G=[int(input()) for _ in range(2)]
print(2*G-R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):

r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
r,g=map(int,open(0).read().split())
print(g*2-r)

Solution (Python):
r,g=map(int,open(0).read().split())
print(2*g-r)

Solution (Python):
a = int(input())
b = int(input())

print (2*b - a)

Solution (Python):
print(-int(input())+int(input())*2)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())

print(G*2-R)

Solution (Python):
R = int(input())
G = int(input())

print(R+(G-R)*2)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):

r = int(input())
g = int(input())
print ( 2 * g - r )

Solution (Python):
r = int(input())
g = int(input())
print((g-r)*2 + r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
a=int(input())
b=int(input())
print(a+2*(b-a))

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())
 
nA = 2 * G - R
 
print(nA)

Solution (Python):


R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
p = G * 2 - R
print(p)

Solution (Python):
R = int(input())
G = int(input())

x = 2*G-R
print (x)

Solution (Python):
print(-int(input()) + 2 * int(input()))

Solution (Python):
r = int(input())
g = int(input())

print((2*g) -r)

Solution (Python):
R=int(input())
G=int(input())

print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(g*2-r)

Solution (Python):
r, g = [int(input()) for _ in range(2)]
print(2 * g - r)

Solution (Python):
now = int(input())
goal = int(input())

print(goal*2-now)

Solution (Python):
r = int(input())
g = int(input())
print((g-r)*2+r)

Solution (Python):
R = int(input())
G = int(input())
print( (G * 2) - R)

Solution (Python):



R = int(input())
G = int(input())


print(2 * G - R)

Solution (Python):
r = int(input())
g = int(input())
print((g-r)*2 + r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r,g=[int(input()) for _ in range(2)]

print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
ans = 2 * G - R

print(ans)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())

print(G*2-R)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
B = int(input())
T = int(input())

print(B+(T - B)*2)

Solution (Python):
R = int(input())
G = int(input())

ans=2*G-R
print(ans)

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):

import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math






def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    R = inputInt()
    G = inputInt()
    
    print((2*G)-R)
    
            	
if __name__ == "__main__":
	main()

Solution (Python):
a,b=int(input()),int(input())
print(2*b-a)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
x = int(input())
y = int(input())
print(2*y -x )

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R, G = map(int, (input() for _ in range(2)))

print(str(2*G-R))

Solution (Python):
r = int(input())
g = int(input())
print (2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(g + (g - r))

Solution (Python):

import sys
INF = float("inf")


def solve(R: int, G: int):
    print(G*2-R)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  
    G = int(next(tokens))  
    solve(R, G)


if __name__ == '__main__':
    main()

Solution (Python):



r = int(input().split()[0])
g = int(input().split()[0])

next = g * 2 - r
print(next)

Solution (Python):
r = int(input())
g = int(input())

print(g + (g - r))

Solution (Python):
r = int(input())
g = int(input())
print(g * 2 - r)

Solution (Python):
i1 = int(input())
i2 = int(input())
print(i2*2-i1)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
 
print(r+(g-r)*2)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):


a = int(input())
b = int(input())

sa = b-a
print(a + 2*sa)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
r = int(input())
g = int(input())
print(g-r+g)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(input())




sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

R = INT()
G = INT()
add = G - R
print(G + add)

Solution (Python):
r = int(input())
g = int(input())
ans = 2 * g - r
print(ans)

Solution (Python):
a = int(input())
b = int(input())
print(b * 2 - a)

Solution (Python):
r,g=map(int,open(0))
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print (2 * G - R)

Solution (Python):
R = int(input())
G = int(input())

tmp = 2 * G
ans = tmp - R
print(ans)

Solution (Python):
print(-int(input())+2*int(input()))

Solution (Python):
r = int(input())
g = int(input())

print(r + (g-r) * 2)

Solution (Python):
r = int(input())
g = int(input())

print(g * 2 - r)

Solution (Python):
R = int(input())
G = int(input())
ans = 2*G - R
print(ans)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
a,b=[int(input()) for i in range(2)]
print(b*2-a)

Solution (Python):
R=int(input())
G=int(input())

print(2*G-R)

Solution (Python):
r=int(input())
g=int(input())
print(g*2 - r)

Solution (Python):
a = int(input())
b = int(input())

print(b + (b-a))

Solution (Python):
a = int(input())
b = int(input())
c = b - a
print(b + c)

Solution (Python):
R = int(input())
G = int(input())
A = 2*G-R
print(A)

Solution (Python):
R = int(input())
G = int(input())
A = 2*G-R
print(A)

Solution (Python):
r = int(input())
g = int(input())
x = 2*g - r
print(x)

Solution (Python):
r = int(input())
g = int(input())



print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())

print(G*2-R)

Solution (Python):



r = int(input())
g = int(input())

print(g + (g-r))

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
a = int(input())
b = int(input())
print(b * 2 - a)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())

print(G + (G - R))

Solution (Python):



R = int(input())
G = int(input())




print((2 * G) - R)

Solution (Python):
r=int(input())
g=int(input())
print(r+(g-r)*2)

Solution (Python):
r = int(input())
g = int(input())
print(g*2-r)

Solution (Python):
a = int(input())
b = int(input())
print(2*b-a)

Solution (Python):
r = float(raw_input())
g = float(raw_input())
print int(2*g - r)

Solution (Python):
R = int(input())
G = int(input())
print(G*2 - R)

Solution (Python):


from sys import stdin


def main():
    r = int(stdin.readline())
    g = int(stdin.readline())
    ans = g * 2 - r
    print(ans)


main()

Solution (Python):
R = int(input())
G = int(input())
print(R + (G - R)*2)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
a = int(input())
b = int(input())

print(2 * b - a)

Solution (Python):
r = int(input())
g = int(input())

print(g*2 - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

R = n()
G = n()

print(2* G - R)

Solution (Python):

import sys


def solve(R: int, G: int):
    
    print(2*G - R)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  
    G = int(next(tokens))  
    solve(R, G)


if __name__ == '__main__':
    main()

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r, g = int(input()), int(input())
print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
ans = 2*g - r
print(ans)

Solution (Python):
def main():
    print(-1 * int(input()) + int(input()) * 2)


main()

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
r = int(input())
g = int(input())
print(int(g*2 - r))

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
r = int(input())
print(int(input())*2-r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R=int(input())
G=int(input())
print(G+(G-R))

Solution (Python):


def main():
    n = int(input())
    k = int(input())

    print(2 * k - n)



if __name__ == '__main__':
    main()

Solution (Python):
r = float(input())
g = float(input())
print(int(r + (g - r)*2))

Solution (Python):
def abc():
    r = int(input())
    g = int(input())
    print(2 * g - r)

abc()

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r,g=[int(input()) for i in range(2)]
print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):


r, g = int(input()), int(input())

ans = 2*g-r
print(ans)

Solution (Python):
a = int(input())
b = int(input())

print(2*b-a)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
r = int(input())
g = int(input())

print(int(2*g-r))

Solution (Python):
r=int(input())
g=int(input())
print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
import sys
input = sys.stdin.readline

r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(R+(G-R)*2)

Solution (Python):
R, G = [int(input()) for _ in range(2)]
print(2 * G - R)

Solution (Python):
print(-int(input())+int(input())*2)

Solution (Python):
a = int(input())
b = int(input())
print(b-a+b)

Solution (Python):
r = int(input())
g = int(input())
print(r + 2*(g-r))

Solution (Python):
a=int(input())
b=int(input())
print(2*b-a)

Solution (Python):
print(-int(input()) + 2 * int(input()))

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
R=int(input())
G=int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(raw_input())
G = int(raw_input())

print R+(G-R)*2

Solution (Python):
R = int(input())
G = int(input())
diff = G - R
print(G+diff)

Solution (Python):
R = int(input())
G = int(input())
print(G*2-R)

Solution (Python):
a = int(input())
b = int(input())
print( b + ( b - a ) )

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())

print(g*2-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
a=int(input())
b=int(input())

print(2*b-a)

Solution (Python):
r = int(input())
g = int(input())

print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(g*2 - r)

Solution (Python):
R = int(input())
G = int(input())

print(G * 2 - R)

Solution (Python):
print(-(int(input())-int(input())*2))

Solution (Python):
r = int(input())
g = int(input())

print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
a = int(input())
b = int(input())
print(2*b-a)

Solution (Python):
a=int(input())
b=int(input())
print(a+2*(b-a))

Solution (Python):
r = int(input())
g = int(input())
x = (2*g) - r
print(x)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):

R = int(input())
G = int(input())

print(G*2-R)

Solution (Python):
R = int(input())
G = int(input())
T = R + 2 * (G - R)
print(T)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
print(int(input()) * -1 + int(input()) * 2)

Solution (Python):
R=int(input())
G=int(input())
print(G*2-R)

Solution (Python):
r=int(input())
g=int(input())
print(int(2*g-r))

Solution (Python):
R=int(input())
print((int(input()))*2-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())

print(2*G - R)

Solution (Python):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
r = int(input())
g = int(input())
print(2 * g - r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G-R)

Solution (Python):
import sys


def input():
    return sys.stdin.readline()[:-1]








a = int(input())
b = int(input())
print(2*b-a)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
current = int(input())
rate = int(input())
print(rate*2-current)

Solution (Python):
a = int(input())
b = int(input())
print(2*b-a)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
R,G=[int(input()) for _ in range(2)]
print(G+G-R)

Solution (Python):
r = int(input())
g = int(input())
print(g*2-r)

Solution (Python):
R = int(input())
G = int(input())

print(R + 2 * (G-R))

Solution (Python):
a = int(input())
b = int(input())
print(b * 2 - a)

Solution (Python):
a = int(input())
b = int(input())
print(2*b-a)

Solution (Python):
r=int(input())
s=int(input())
print(2*s-r)

Solution (Python):
R=int(input())
G=int(input())
print(G*2-R)

Solution (Python):
R,G=(int(input()) for i in range(2))
print(G*2-R)

Solution (Python):
R,G=(int(input()) for i in range(2))
print(G*2-R)

Solution (Python):

import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(R: int, G: int):
    return 2 * G - R


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    R = int(next(tokens))  
    G = int(next(tokens))  
    result = solve(R, G)
    if isinstance(result, Iterable):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
print(-int(input()) + 2*int(input()))

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    R = int(input())
    G = int(input())
    
    print(2*G - R)
    
if __name__ == '__main__':
    main()

Solution (Python):


import sys
import math


r = int(input())
g = int(input())

print(g+(g-r))

Solution (Python):

def read_input():
    r = int(input())
    g = int(input())
    return r, g


def submit():
    r, g = read_input()

    print(r + 2*(g - r))



if __name__ == '__main__':
    submit()

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    r = f()[0]
    g = f()[0]

    print(r + 2*(g-r))

solve()

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
a=int(input())
b=int(input())


print(int(2*b-a))

Solution (Python):
a = int(input())
b = int(input())
c = b*2 - a
print(c)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
print(-int(input())+int(input())*2)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
r = int(input())
g = int(input())

print(2*g - r)

Solution (Python):
r=int(input())
g=int(input())
ans=g*2-r
print(ans)

Solution (Python):
R = int(input())
G = int(input())

print(G*2-R)

Solution (Python):
r=int(input())
g=int(input())
print(2*g-r)

Solution (Python):
R = int(input())
G = int(input())
print(2*G - R)

Solution (Python):


r, g = [int(input()) for _ in range(2)]

print(2*g - r)

Solution (Python):
a = int(input())
b = int(input())

print(b + b - a)

Solution (Python):
R = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
R = int(input())
G = int(input())

print(2 * G - R)

Solution (Python):
print(int(input())*-1+int(input())*2)

Solution (Python):
r = int(input())
g = int(input())
print(2*g - r)

Solution (Python):
R = int(input())
G = int(input())

print(2*G -R)

Solution (Python):
print(-int(input())+int(input())*2)