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


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

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

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

Solution (Python):

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    R=I()
    G=I()
    print(G*2-R)

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

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

Solution (Python):



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


print(2*G-R)

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

Solution (Python):
a,b=[int(input()) for i in range(2)]
print(b-a+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 = input()
G = input()
R = int(R)
G = int(G)

print(G*2 - R)

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

n = -r
while True:
    x = (r + n) / 2
    if x == g:
        print(n)
        break
    n += 1

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


if __name__ == '__main__':
    main()

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

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    R=I()
    G=I()
    print(G+(G-R))

if __name__ == '__main__':
    main()

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())
d = G-R
print(G+d)

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 newrating(r , g):

    return (g - r) + g

def main():
    r = int(input())
    g = int(input())
    print(newrating(r , g))

if __name__ == '__main__':
    main()

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().strip())
g = int(input().strip())

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

    for x in range(-9 * 10 ** 3, 9 * 10 ** 3 + 1):
        if R + x == G * 2:
            print(x)
            return

    print(-1)


if __name__ == '__main__':
    main()

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

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

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




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

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

print(2*g-r)

Solution (Python):
import sys
stdin = sys.stdin
from itertools import product

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

r = ni()
g = ni()
print(g + (g-r))

Solution (Python):
import sys
input = sys.stdin.readline
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 = 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):
a=int(input())
b=int(input())
print(2*b-a)

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())
d = G-R
print(G+d)

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

Solution (Python):
now_r = int(input())
target = int(input())

print((target * 2) - now_r)

Solution (Python):

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


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

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

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

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

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

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

print(b*2-a)

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

print(2*g-r)

Solution (Python):
str = input().split()
r = int(str[0])
str = input().split()
g = int(str[0])
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())

sa = g - r

print(g + sa)

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




def main():
    R = int(input())
    G = int(input())
    print(G * 2 - 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(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):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools



read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B = map(int,read().decode('utf8').split())
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((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())

ans = 2 * (g - r)

print(r + ans)

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

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

print((g*2)-r)

Solution (Python):
x = int(input())
ave = int(input())

print(2*ave-x)

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

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

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

a,b = (int(input()) for _ in range(2))
print(2*b-a)

Solution (Python):


import numpy as np

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):
import sys
input = sys.stdin.readline
R = int(input())
G = int(input())
print(2 * G - R)

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

r = (G-R)*2 + R

print(r)

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

Solution (Python):


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

N = 2 * G - R

print(N)

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

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

print(g + (g-r))

Solution (Python):

a = int(input())
c = int(input())

print(2*c-a)

Solution (Python):
import sys
input = sys.stdin.readline
r=int(input())
g=int(input())
print(g+g-r)

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

if r<g:
  print(r+2*abs(r-g))
elif r>g:
  print(r-2*abs(r-g))
else:
  print(r)

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

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

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

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

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

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

print(2*G-a)

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

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

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

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

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

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

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

Solution (Python):
import sys

r, g = map(int, sys.stdin.read().split())

def main():
    return g * 2 - r

if __name__ == '__main__':
    ans = main()
    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())
print(2*g-r)

Solution (Python):
import math

r, g = [int(input()) for i in range(2)]
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(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*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 = int(input())
G = int(input())
print(2 * G - R)

Solution (Python):
a= int(input())
b= int(input())
c=0
if a<b:
  c=b+(b-a)
else:
  c=b-(a-b)
print(c)

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

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

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

t = 2*g -r

print(t)

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

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

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)*2+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())
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,g = [int(input()) for i in range(2)]

p=g*2-r

print(p)

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

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

next_performance = G * 2 - R

print(next_performance)

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

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

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

Solution (Python):

import math


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

print ((G*2) - R)

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

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

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

X = ((2*G)-R)

print(X)

Solution (Python):
from sys import stdin
import math
import bisect
import heapq
import numpy as np
from math import factorial

r = int(stdin.readline().rstrip())
g = int(stdin.readline().rstrip())

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):
from sys import stdin
R = int(stdin.readline().rstrip())
G = int(stdin.readline().rstrip())
print(G*2-R)

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

print(2*g - r)

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

Solution (Python):
def examA():
    R = I(); G = I()
    ans = G + (G-R)
    print(ans)



import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

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

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

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

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

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

b = int(input())

c = (b-a) + b

print(c)

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



x = 2*b - a
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(r + (g-r)*2)

Solution (Python):

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

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

Solution (Python):
import sys

r, g = (int(x) for x in sys.stdin.read().split())
ans = g * 2 - r
print(ans)

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

print(g + (g - r))

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

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

Solution (Python):

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

print(g * 2 - r)

Solution (Python):

n = int(input())
m = int(input())
print(m + m - n)

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

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

Solution (Python):
r, g = [int(input()) for _ in range(2)]
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):
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):
import sys
from itertools import accumulate
input = sys.stdin.readline
def inputs():return [int(x) for x in input().split()]
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(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(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(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(g + (g - r))

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

Solution (Python):
a, b = [int(input()) for _ in range(2)]
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(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()) for i in range(2)]
R=a[0]
G=a[1]
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())

X = G*2 - R
print(X)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    r=INT()
    g=INT()
    print(2*g-r)
if __name__ == '__main__':
    do()

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

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

Solution (Python):

data = list(map(int, open(0).read().split()))
print(data[1] * 2 - data[0])

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/2)))

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

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    r = int(input().rstrip('\n'))
    g = int(input().rstrip('\n'))
    print(2 * g - r)


if __name__ == '__main__':
    slove()

Solution (Python):
import sys

input = sys.stdin.readline


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

print(x)

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

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

ans = 2 * G - R
print(ans)

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

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