using System;
using System.Collections.Generic;
namespace Atcoder20190616
{
class ProgramA
{
static void Main(string args)
{
string input = Console.ReadLine().Split();
int a = int.Parse(input[0]);
int b = int.Parse(input[1]);
if(a <= 2 * b)
Console.WriteLine("0");
else
Console.WriteLine(a - 2 * b);
}
}
class ProgramB
{
static void Main(string args)
{
string input = Console.ReadLine();
int n = int.Parse(input);
int tako = new int[n];
string takoyaki = Console.ReadLine().Split();
int sum = 0;
for(int i = 0;i < n ;i++)
tako[i] = int.Parse(takoyaki[i]);
for(int i = 0; i < n; i++)
for(int j = i + 1; j < n;j++)
{
sum += tako[i] * tako[j];
}
Console.WriteLine(sum);
}
}
class ProgramC
{
static void Main(string args)
{
string input = Console.ReadLine();
int n = int.Parse(input);
string slime = Console.ReadLine();
int count = 0;
for(int i = 0; i < n - 1;i++)
{
if(slime[i] != slime[i + 1])
count++;
}
Console.WriteLine(count + 1);
}
}
class ProgramD
{
static void Main(string args)
{
string input = Console.ReadLine();
int n = int.Parse(input);
string L = Console.ReadLine().Split();
int count = 0;
int Li = new int[n];
for(int i = 0; i < n;i++)
Li[i] = int.Parse(L[i]);
Array.Sort(Li);
for(int i = n - 1; i > 1 ;i--)
{
int a = Li[i];
for(int j = i - 1; j >= 0;j--)
{
int b = Li[j];
for(int k = j - 1; k >= 0;k--)
{
int c = Li[k];
if(a < c + b)
count++;
else
continue;
}
}
}
Console.WriteLine(count);
}
}
class ProgramE
{
static void Main(string args)
{
string input = Console.ReadLine().Split();
int n = int.Parse(input[0]);
int m = int.Parse(input[1]);
int L = int.Parse(input[2]);
int[,] road = new int[n,n];
int[,] gas = new int[n,n];
int Inf = 100000000;
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
{
if(i == j)
road[i , j] = 0;
else
road[i , j] = Inf;
}
for(int i = 0; i < m; i++)
{
string input_road = Console.ReadLine().Split();
int a = int.Parse(input_road[0]);
int b = int.Parse(input_road[1]);
int c = int.Parse(input_road[2]);
road[a - 1, b - 1] = c;
road[b - 1, a - 1] = c;
}
for(int s = 0; s < n;s++)
for(int t = 0; t < n;t++)
for(int u = 0; u < n;u++)
road[t, u] = Math.Min(road[t, u], road[t, s] + road[s, u]);
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
{
if(road[i, j] <= L)
gas[i , j] = 1;
else
gas[i , j] = Inf;
}
for(int s = 0; s < n;s++)
for(int t = 0; t < n;t++)
for(int u = 0; u < n;u++)
gas[t, u] = Math.Min(gas[t, u], gas[t, s] + gas[s, u]);
string input_Q = Console.ReadLine();
int Q = int.Parse(input_Q);
for(int i = 0; i < Q;i++)
{
string input_st = Console.ReadLine().Split();
int s = int.Parse(input_st[0]);
int t = int.Parse(input_st[1]);
if(gas[s, t] >= Inf)
Console.WriteLine("-1");
else
Console.WriteLine(gas[s, t] - 1);
}
}
}
}