#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2025;
const int MOD = 998244353;
int n, k;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) (ch == '-') && (f = -f), ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
namespace subtask1 {
int f[MAXN], ans;
int main() {
  f[0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = i; j <= n; ++j) (f[j] += f[j - i]) %= MOD;
  for (int i = 1; i <= n; ++i) (ans += f[i]) %= MOD;
  printf("%d\n", ans);
  return 0;
}
}  // namespace subtask1
namespace subtask2 {
int f[MAXN], ans;
int main() {
  f[0] = 1;
  for (int i = 1; i * (i + 1) / 2 <= n; ++i)
    for (int j = i * (i + 1) / 2; j <= n; ++j)
      (f[j] += f[j - i * (i + 1) / 2]) %= MOD;
  for (int i = 1; i <= n; ++i) (ans += f[i]) %= MOD;
  printf("%d\n", ans);
  return 0;
}
}  // namespace subtask2
namespace subtaskK {
int stk[MAXN], maxn = 64, ans;
int b[MAXN], m, c[MAXN], s;
inline int getsum() {
  int ans = 0;
  for (int i = 1; i <= m; ++i) ans += b[i];
  return ans;
}
inline bool check(int top) {
  int i, j, l;
  m = top;
  memcpy(b, stk, sizeof(int) * (m + 1));
  for (l = 1; l <= k - 1; ++l) {
    s = 0;
    for (i = m; i >= 1 && s <= n; --i)
      for (j = 1; j <= b[i] && s <= n; ++j) c[++s] = m - i + 1;
    if (s > n) return 0;
    m = s;
    memcpy(b, c, sizeof(int) * (m + 1));
  }
  return getsum() <= n;
}
void dfs(int dep, int now, int last) {
  if (dep != 1) {
    if (check(dep - 1))
      ++ans;
    else
      return;
  }
  for (int i = last; i + now <= maxn; ++i)
    stk[dep] = i, dfs(dep + 1, now + i, i);
}
int main() {
  dfs(1, 0, 1);
  printf("%d\n", ans);
  return 0;
}
}  // namespace subtaskK
int main() {
  n = read();
  k = read();
  if (k == 1)
    return subtask1::main();
  else if (k == 2)
    return subtask2::main();
  else
    return subtaskK::main();
  return 0;
}
