import sys
input = sys.stdin.readline
from itertools import *
from collections import *

INF = float('inf')


def main():
    A, B = map(int, input().split())
    yohaku = A - 2 * B
    print(yohaku if yohaku > 0 else 0)


if __name__ == '__main__':
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from itertools import * from collections import * INF = float('inf') INF float('inf') float 'inf' def main():
    A, B = map(int, input().split())
    yohaku = A - 2 * B
    print(yohaku if yohaku > 0 else 0) main A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B yohaku = A - 2 * B yohaku A - 2 * B A 2 * B 2 B print(yohaku if yohaku > 0 else 0) print yohaku if yohaku > 0 else 0 yohaku > 0 yohaku 0 yohaku 0 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = sys.stdin.readline sys.stdin.readline input def main():
    A, B = map(int, input().split())
    yohaku = A - 2 * B
    print(yohaku if yohaku > 0 else 0) def main():
    A, B = map(int, input().split())
    yohaku = A - 2 * B
    print(yohaku if yohaku > 0 else 0) main INF = float('inf') float('inf') INF
import sys
input = sys.stdin.readline
from itertools import *
from collections import *

INF = float('inf')


def main():
    A, B = map(int, input().split())
    yohaku = A - 2 * B
    print(yohaku if yohaku > 0 else 0)


if __name__ == '__main__':
    main()
