#include <stdio.h>

int main() {
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d\n", 2 * b - a);
    return 0;
}

等差数列an=a1+(n-1)d, a1+a3=2a2