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):

n=[]
for i in range(2):
  n.append(int(input()))
n1=n[1]*2-n[0]
print(n1)

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

Solution (Python):
print -input() + 2*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):
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):
r=int(input())
g=int(input())
print(2*g-r)

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

print((G-R)+G)

Solution (Python):
A=int(input())
B=int(input())
print(B*2-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):
[r,g]=[int(input()) for i in range(2)]
print(2*g-r)

Solution (Python):
r=int(input())
g=int(input())
print(g+abs(r-g) if r<g else g-abs(r-g))

Solution (Python):
R=int(input().strip())
G=int(input().strip())
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):
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(2*G-R)

Solution (Python):
def main():
    R = int(input())
    G = int(input())
    return 2 * G - R

if __name__ == '__main__':
    print(main())

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

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(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):
print -input()+input()*2

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

Solution (Python):

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

Solution (Python):
a = []
for i in range(2):
    a.append(input()) 
R=int(a[0])
G=int(a[1])
print(2*G-R)

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

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

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

print(2*G-R)

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

print('{}'.format((2*g-a)))

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

print(2 * G - R)

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

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

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):
R = int(input())
G = int(input())

print(2*G-R)

Solution (Python):
a = int(input())
b = int(input())
print((b-a) * 2 + 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, g = int(input()), 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):
a = int(input())
b = int(input())
print(b*2-a)

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

r = ni()
g = ni()

print(g*2-r)

Solution (Python):
R = int(raw_input())
G = int(raw_input())
print R + 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*2)-r)

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

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

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

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

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

Solution (Python):
r=float(raw_input())
g=float(raw_input())

if int(g*2-r)==float(g*2-r):
	print int(g*2-r)
else:
	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 = int(input()),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(2*B-A)

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

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):
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):
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(r+(g-r)*2)

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

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

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

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())
a=2*G-R
print(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())+int(input())*2)

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*2-R)

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

Solution (Python):

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

print(2 * g - r)

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

r = int(arr_data[0][0])
g = int(arr_data[1][0])


print(g*2-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+g-r)

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

print(2*N-R)

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

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

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 = int(input())
G = int(input())
print(2*G-R)

Solution (Python):

print(-int(input())+2*int(input()))

Solution (Python):





if __name__ == '__main__':
    current_rating = int(input())
    target_rating = int(input())

    result = 2 * target_rating - current_rating
    print(result)

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

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

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

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

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(10000)


def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))


def to_bin(x):
    return bin(x)[2:]


def dim2input(N):
    li = []
    for _ in range(N):
        li.append(input().split())
    return li



dp = None

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

    print(R+diff*2)

main()

Solution (Python):


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

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=(float(input()) for i in range(2))
print(int(2*g-r))

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

r = 2 * G - R
print(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(R + 2 *(G - R))

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

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

Solution (Python):
r, g = [int(input()) for i 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())
x=int(2*G-R)
print(x)

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

print(g*2 - r)

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

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, g = int(input()),int(input())
print(2*g-r)

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

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())



ans = int(2*g - r)

print(ans)

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(r+(g-r)*2)

Solution (Python):
R = input()
G = 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):
print(-int(input())+2*int(input()))

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 math

r = input()
g = input()

b = float(g)*2.0-float(r)
print(math.ceil(b))

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

print(2*G-R)

Solution (Python):
import math

r = input()
g = input()

b = float(g)*2.0-float(r)
print(math.ceil(b))

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):
print -(input() - input()*2)

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

Solution (Python):
print(-1*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(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((G-R)*2+R)

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


print(g*2 - r)

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

Solution (Python):


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):
a = int(input())
b = int(input())
print(2*b-a)

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

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

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

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

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*2-R)

Solution (Python):
def rating_goal(R,G):
	print(G * 2 - R)

R = int(input())
G = int(input())
rating_goal(R,G)

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

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

def main():
    print(2 * G - R)

if __name__ == '__main__':
    main()

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

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())
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):
r = int(input())
g = int(input())
print( g*2 - r )

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")
 
 
def main():
    R = int(input())
    G = int(input())
 
    print(G + (G - R))
 
 
if __name__ == '__main__':
    main()

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

Solution (Python):
import sys


def main():

    
    args = _input_args()  

    
    result = _main(args)

    
    _export_result(result)


def _main(args):
    """Write Main Logic here for the contest.

    :param args: arguments
    :type args: list
    :return: result
    :rtype: depends on your logic.
    """
    
    R = int(args[0])
    G = int(args[1])

    
    X = (2 * G) - R

    
    return X


def _input_args():
    

    
    

    
    arguments = _get_args_from_multiple_lines(end_of_lines_char=[''])

    
    

    return arguments  


def _input():
    
    return input()  


def _get_args_from_multiple_lines(end_of_lines_char=['']):
    """Get arguments from multiple lines standard input.

    :param end_of_lines_char: Strings that indicate the end of lines.
    :type end_of_lines_char: list of str
    :return: args
    :rtype list of str
    """
    args = []
    while True:
        try:
            arg = _input()
            if arg in end_of_lines_char:
                break
            args.append(arg)
        except EOFError:  
            break
    return args


def _export_result(result):
    

    
    
    
    
    print('{}'.format(str(result)))  


if __name__ == '__main__':
    main()

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

Solution (Python):
now_rate = int(input())
goal_rate = int(input())

perform = goal_rate * 2 - now_rate

print(perform)

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

Solution (Python):


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

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

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

x = 2*G -R
print(x)

Solution (Python):


if __name__ == "__main__":
    R = int(input())
    G = int(input())
    parformans = 0.0

    parformans = 2 * G - R
    print(parformans)

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

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

Solution (Python):
r = input()
g = 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):
r = int(input())
g = int(input())
goal = 2*g - r
print(goal)

Solution (Python):


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

diff = G - R
print(diff+ G)

Solution (Python):


def f(R, G):
    return 2*G-R

def test():
    assert f(2002, 2017) == 2032
    assert f(4500, 0) == -4500

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

    print(f(R,G))


if __name__ == '__main__':
    main()

Solution (Python):


now_rate = int(input())
goal_rate = int(input())

ans = 2*goal_rate-now_rate
print(ans)

Solution (Python):


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

print( (2*g-r)//1 )

Solution (Python):
pres_rate = int(input())
goal_rate = int(input())
next_rate = goal_rate * 2 - pres_rate
print(next_rate)

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

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

output = (G * 2) - R
print(output)

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

Solution (Python):

r,g = (int(input()), 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):
p1 = input();
p2 = input();
print(int(p2) +(int(p2) - int(p1)));

Solution (Python):


r=int(raw_input())
g=int(raw_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())
x = 2*G - R
print(x)

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

b=b*2
c = b-a
print(c)

Solution (Python):
a,b=int(input()),int(input())
print(a+(b-a)*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())+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())
a = int(input())
print(a*2-r)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


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

    print(G + (G - R))


if __name__ == '__main__':
    main()

Solution (Python):
rating1=int(input())
expectation=int(input())
rating2=2*expectation-rating1
print(rating2)

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

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

Solution (Python):
R = int(raw_input())
G = int(raw_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):
r = int(input())
g = int(input())
print(2*g-r)

Solution (Python):
R, G = map(int, (input(), 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):
R = input()
G = input()
print(2*G - R)

Solution (Python):
R=input()
G=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):
def main():
    r = int(input())
    g = int(input())
    print(g*2 - r)


if __name__ == "__main__":
    main()

Solution (Python):





from sys import stdin

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

R = int(stdin.readline())
G = int(stdin.readline())
print(solve(R, G))

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


if __name__ == "__main__":
    main()

Solution (Python):
R = 0
G = 0

def solve():
    R = int(input())
    G = int(input())
    print((G-R)*2+R)

solve()

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

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

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

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

Solution (Python):
i,p=int,input
print(-i(p())+2*i(p()))

Solution (Python):
R=int(raw_input())
G=int(raw_input())
x=0
if 0<=R<=4500 and 0<=G<=4500:
    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())
print(g*2-r)

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

Solution (Python):


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

print((G-R)+G)

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

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

print(2*g-r)

Solution (Python):

r = int(raw_input())
g = int(raw_input())
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())
b = 2*G - R
print(b)

Solution (Python):
import sys

cur = sys.stdin.readline()
target = sys.stdin.readline()

a = int(target) * 2 - int(cur)

print (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=input()
G=input()

x = int(int(G) * 2 - int(R))
print(x)

Solution (Python):
if __name__ == "__main__":
    r = int(input())
    g = int(input())
    diff=g-r
    print(g+diff)

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

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

Solution (Python):


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

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

A =G * 2 - R

print(A)

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

Solution (Python):
a =  float(raw_input())
c = float(raw_input())
print int(2*c-a)

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

Solution (Python):
r = int(raw_input())
g = int(raw_input())
if(r > g):
  print(g - (r-g))
if(g > r):
    print (g + (g - r))
if(g == r):
    print(r)

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

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

print(x)

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

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

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

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

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

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(str(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( 2*G-R)

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

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

    
    print(G * 2 - R)

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):
R = int(input())
G = int(input())

print(2 * G - R)

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

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

print(G+(G-R))

Solution (Python):

N1 = int(input())
N2 = int(input())


N3 = (N2 *2)-N1

print(N3)

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

N=2*G-R

print('{0}'.format(N))

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

Solution (Python):

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

Solution (Python):
n = int(input())
hoge = int(input())

print(hoge - n + hoge)

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())
ans = G*2 -R
print(ans)

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

print(ans)

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

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

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

A = 2 * G - R
print(A)

Solution (Python):

"""
http://abc076.contest.atcoder.jp/tasks/abc076_a

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    R = int(input())
    G = int(input())
    x = 2*G - R
    print(x)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):


import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        R = int(line)
        G = int(sys.stdin.readline())
        print(2*G - R)

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

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

print 2*G-R

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

Solution (Python):
import sys

r = int(sys.stdin.readline().strip())
g = int(sys.stdin.readline().strip())

print(2*g - r)

Solution (Python):



"""076-a"""


import sys


def main():
    """Main function."""
    R = int(input())
    G = int(input())

    print(2 * G - R)


if __name__ == '__main__':
    sys.exit(main())

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())

ans=R+(G-R)*2

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(2*G-R)

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

result = G * 2 - R
print(result)

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

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(raw_input())
G = int(raw_input())
print 2 * G - R

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

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

    x = 2 * G - R
    print(x)

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):

import sys, re, copy, math, itertools
from copy import *
from collections import deque, defaultdict
from heapq import *
from bisect import *




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())

b = 2*G - R
print(b)

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

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

    N = (2*G) - R
    print(N)

if __name__ == "__main__":
    main()

Solution (Python):






R=int(input().rstrip())
G=int(input().rstrip())





print((2*G)-R,flush=True)

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

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

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

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

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

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

print G * 2 - R

Solution (Python):

R = int(raw_input())
G = int(raw_input())
print 2 * G - R

Solution (Python):


def main():
	r = int(input())
	g = int(input())
	print(2 * g - r)

if __name__ == '__main__':
	main()

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

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

print(D + (D-R))

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

Result = B*2-A
print(Result)

Solution (Python):
from sys import stdin, stdout
from collections import defaultdict
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readLine_int_list_reverse(): return list(map(int, stdin.readline().split())).reverse()
def readAll_int(): return list(map(int, stdin))
def readLine_str_list():return list(map(str, stdin.readline().split()))
def readAll_str(): return list(map(str, stdin))


def main():
	a,b = readAll_int()
	print((2*b)-a)

if __name__ == "__main__":
    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)