#include <iostream>

using namespace std;

size_t f(size_t L, size_t N)    // a + b = L and 1 <= a, b, <= L の組の数
{
    if (L <= N + 1)
    {
        return (L - 1);   // (1, L-1) .. (L-1, 1)
    }
    else if (2 * N < L)
    {
        return 0;
    }
    else
    {
        return (2 * N - L + 1);    // (L-N, N) .. (N, L-N)
    }
}

int main()
{
    int N, K;          // 1 <= a, b, c, d <= N and a + b - c - d = K
    cin >> N >> K;

    size_t ans = 0;
    for (int l = 2; l <= 2 * N; ++l)
    {
        int m = l - K;

        if (m >= 2)
        {
            ans += f(static_cast<size_t>(l), N) * f(static_cast<size_t>(m), N);
        }
    }

    cout << ans << endl;

    return 0;
}

#include <algorithm>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>

using namespace std;

int main() {
  string S, T;
  cin >> S >> T;

  if (S == "Y") {
    for_each(T.begin(), T.end(), [](char& c) { c = toupper(c); });
    cout << T << endl;
  } else {
    cout << T << endl;
  }

  return 0;
}
