#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define pa pair<int, int>
#define pal pair<long long, long long>
#define pali pair<long long, int>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define COUT(v)                                                                \\
  for (int64_t i = 0; i < (v).size(); ++i) {                                   \\
    cout << v.at(i) << endl;                                                   \\
  }
#define REP(i, n) for (int64_t i = 0; i < n; ++i)
#define FOR(i, r, n) for (int64_t i = (r); i < n; ++i)
#define VIN(v)                                                                 \\
  for (int64_t i = 0; i < (v).size(); ++i) {                                   \\
    cin >> (v).at(i);                                                          \\
  }

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pavec;
typedef vector<pali> palivec;
typedef vector<pal> palvec;

typedef vector<vector<bool>> bmat;
typedef vector<vector<int>> imat;
typedef vector<vector<long long>> lmat;

typedef vector<string> svec;
typedef vector<vector<string>> smat;
const ll infll = (1LL << 60) - 1;
const int inf = (1 << 30) - 1;
const ll MOD = 1000000007;

ll gcd(ll x, ll y) {
  ll r = x % y;
  if (r == 0)
    return y;
  else
    return gcd(y, r);
}

ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

lvec mfactor(ll n) {
  bvec ip(n, true);
  lvec mf(n, -1);
  ip[0] = false;
  ip[1] = false;
  mf[0] = 0;
  mf[1] = 1;
  REP(i, n) {
    if (ip[i]) {
      mf[i] = i;
      for (ll j = i * i; j < n; j += i) {
        ip[j] = false;
        if (mf[j] == -1)
          mf[j] = i;
      }
    }
  }
  return mf;
}

palivec get_prime(ll n, const lvec &mf) {
  palivec plist;
  while (n != 1) {
    int cnt = 0;
    ll m = mf[n];
    while (mf[n] == m) {
      cnt++;
      n /= m;
    }
    plist.pb(pali(m, cnt));
  }
  return plist;
}

void COMinit(int m, lvec &fac, lvec &finv) {
  lvec inv(m);
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < m; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

ll pow_mod(ll a, ll n) {
  ll x = 1;
  while (n > 0) {
    if (n & 1) {
      x = x * a % MOD;
    }
    a = a * a % MOD;
    n >>= 1;
  }
  return x;
}

ll pow_mod2(ll a, ll n) {
  ll x = 1;
  while (n > 0) {
    if (n & 1) {
      x = x * a;
    }
    a = a * a;
    n >>= 1;
  }
  return x;
}

ll COM(int n, int k, const lvec &fac, const lvec &finv) {
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return (fac[n] * (finv[k] * finv[n - k] % MOD)) % MOD;
}

ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0)
    u += m;
  return u;
}

// union by size + path having
class UnionFind {
public:
  vector<ll> par;
  vector<ll> siz;

  // Constructor
  UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
    for (ll i = 0; i < sz_; ++i)
      par[i] = i;
  }
  void init(ll sz_) {
    par.resize(sz_);
    siz.assign(sz_, 1LL);
    for (ll i = 0; i < sz_; ++i)
      par[i] = i;
  }

  // Member Function
  // Find
  ll root(ll x) {
    while (par[x] != x) {
      x = par[x] = par[par[x]];
    }
    return x;
  }

  // Union(Unite, Merge)
  bool merge(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x == y)
      return false;
    if (siz[x] < siz[y])
      swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }

  bool issame(ll x, ll y) { return root(x) == root(y); }

  ll size(ll x) { return siz[root(x)]; }
};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  ll cnt = 0;

  bvec plist(n + 1, true);
  plist[0] = false;
  plist[1] = false;
  for (int i = 2; i * i < n + 1; i++) {
    if (plist[i]) {
      for (int j = 2; j * i < n + 1; j++) {
        plist[j * i] = false;
      }
    }
  }
  /*
  lvec p;
  for (int i = 0; i < n + 1; i++)
  {
      if (plist[i])
      {
          p.pb(i);
      }
  }
  */

  ll ans = 0;
  for (int i = 1; i < n; i++) {
    ll x = n - i;
    ll cnt = 0;
    if (plist[x]) {
      ans += 2;
      continue;
    }
    for (int j = 1; j * j < x + 1; j++) {
      if (x % j == 0) {
        if (x / j == j) {
          ++cnt;
        } else {
          cnt += 2;
        }
      }
    }
    ans += cnt;
    /*
    for (auto v : p)
    {
        while (x % v == 0)
        {
            x /= v;
            ++cnt;
        }
        if ((x == 1) || plist[x])
        {
            break;
        }
    }
    ans += cnt;
    */
  }

  cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define pa pair<int, int>
#define pal pair<long long, long long>
#define pali pair<long long, int>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define COUT(v)                                                                \\
  for (int64_t i = 0; i < (v).size(); ++i) {                                   \\
    cout << v.at(i) << endl;                                                   \\
  }
#define REP(i, n) for (int64_t i = 0; i < n; ++i)
#define FOR(i, r, n) for (int64_t i = (r); i < n; ++i)
#define VIN(v)                                                                 \\
  for (int64_t i = 0; i < (v).size(); ++i) {                                   \\
    cin >> (v).at(i);                                                          \\
  }

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pavec;
typedef vector<pali> palivec;
typedef vector<pal> palvec;

typedef vector<vector<bool>> bmat;
typedef vector<vector<int>> imat;
typedef vector<vector<long long>> lmat;

typedef vector<string> svec;
typedef vector<vector<string>> smat;
const ll infll = (1LL << 60) - 1;
const int inf = (1 << 30) - 1;
const ll MOD = 1000000007;

ll gcd(ll x, ll y) {
  ll r = x % y;
  if (r == 0)
    return y;
  else
    return gcd(y, r);
}

ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

lvec mfactor(ll n) {
  bvec ip(n, true);
  lvec mf(n, -1);
  ip[0] = false;
  ip[1] = false;
  mf[0] = 0;
  mf[1] = 1;
  REP(i, n) {
    if (ip[i]) {
      mf[i] = i;
      for (ll j = i * i; j < n; j += i) {
        ip[j] = false;
        if (mf[j] == -1)
          mf[j] = i;
      }
    }
  }
  return mf;
}

palivec get_prime(ll n, const lvec &mf) {
  palivec plist;
  while (n != 1) {
    int cnt = 0;
    ll m = mf[n];
    while (mf[n] == m) {
      cnt++;
      n /= m;
    }
    plist.pb(pali(m, cnt));
  }
  return plist;
}

void COMinit(int m, lvec &fac, lvec &finv) {
  lvec inv(m);
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < m; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

ll pow_mod(ll a, ll n) {
  ll x = 1;
  while (n > 0) {
    if (n & 1) {
      x = x * a % MOD;
    }
    a = a * a % MOD;
    n >>= 1;
  }
  return x;
}

ll pow_mod2(ll a, ll n) {
  ll x = 1;
  while (n > 0) {
    if (n & 1) {
      x = x * a;
    }
    a = a * a;
    n >>= 1;
  }
  return x;
}

ll COM(int n, int k, const lvec &fac, const lvec &finv) {
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return (fac[n] * (finv[k] * finv[n - k] % MOD)) % MOD;
}

ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0)
    u += m;
  return u;
}

// union by size + path having
class UnionFind {
public:
  vector<ll> par;
  vector<ll> siz;

  // Constructor
  UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
    for (ll i = 0; i < sz_; ++i)
      par[i] = i;
  }
  void init(ll sz_) {
    par.resize(sz_);
    siz.assign(sz_, 1LL);
    for (ll i = 0; i < sz_; ++i)
      par[i] = i;
  }

  // Member Function
  // Find
  ll root(ll x) {
    while (par[x] != x) {
      x = par[x] = par[par[x]];
    }
    return x;
  }

  // Union(Unite, Merge)
  bool merge(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x == y)
      return false;
    if (siz[x] < siz[y])
      swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }

  bool issame(ll x, ll y) { return root(x) == root(y); }

  ll size(ll x) { return siz[root(x)]; }
};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  ll cnt = 0;

  bvec plist(n + 1, true);
  plist[0] = false;
  plist[1] = false;
  for (int i = 2; i * i < n + 1; i++) {
    if (plist[i]) {
      for (int j = 2; j * i < n + 1; j++) {
        plist[j * i] = false;
      }
    }
  }
  lvec p;
  for (int i = 0; i < n + 1; i++) {
    if (plist[i]) {
      p.pb(i);
    }
  }

  ll ans = 0;
  for (int i = 1; i < n - 1; i++) {
    ll x = n - i;
    if (plist[x]) {
      ans += 2;
      continue;
    }

    ll cnt = 1;
    for (auto v : p) {
      ll cc = 0;
      while (x % v == 0) {
        x /= v;
        ++cc;
      }
      cnt *= (cc + 1);
      if ((x == 1)) {
        break;
      }
      if (plist[x]) {
        cnt *= 2;
        break;
      }
    }

    ans += cnt;
  }

  cout << ++ans << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int count = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 1; j < n; j++) {
      for (int k = 1; k < n; k++) {
        if (i * j + k == n)
          count++;
      }
    }
  }

  cout << count << "\\n";
  return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int count = 0;
  // This is brute force.
  // for(int i=1;i<n;i++){
  //     for(int j=1;j<n;j++){
  //         for(int k=1;k<n;k++){
  //             if(i*j+k==n)
  //             count++;
  //         }
  //     }
  // }

  for (int i = 1; i < n; i++) {
    count += (n - 1) / i;
  }
  cout << count << "\\n";
  return 0;
}


#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL)
#define frr(i, s, n) for (int i = s; i <= n; i++)
#define fr(i, s, n) for (int i = s; i < n; i++)
#define lli long long int
#define llu unsigned long long int
#define vi vector<int>
#define vii vector<long long int>
#define pb push_back
#define eb emplace_back
#define pi pair<int, int>
#define mk make_pair
#define mpp map<int, int>
#define ff first
#define ss second
#define mod 1000000007

using namespace std;
void loop() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 1; j <= n - 1; j++) {
      for (int k = 1; k <= n - 1; k++) {
        if (((i * j) + k) == n)
          cnt++;
        if (((i * j) + k) >= n)
          break;
      }
    }
  }
  cout << cnt << "\\n";
}
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  fast;
  int t = 1;
  // cin>>t;
  while (t--)
    loop();
}

#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL)
#define frr(i, s, n) for (int i = s; i <= n; i++)
#define fr(i, s, n) for (int i = s; i < n; i++)
#define lli long long int
#define llu unsigned long long int
#define vi vector<int>
#define vii vector<long long int>
#define pb push_back
#define eb emplace_back
#define pi pair<int, int>
#define mk make_pair
#define mpp map<int, int>
#define ff first
#define ss second
#define mod 1000000007

using namespace std;
void loop() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 1; j <= n - 1; j++) {
      if ((n - (i * j)) >= 1) {
        if ((n - (i * j)) <= n)
          cnt++;
        else
          break;
      } else
        break;
    }
  }
  cout << cnt << "\\n";
}
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  fast;
  int t = 1;
  // cin>>t;
  while (t--)
    loop();
}


#include <bits/stdc++.h>

using namespace std;
using ll = std::int_fast32_t;

#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll N;
  cin >> N;
  ll count{0};

  for (ll C = N - 1; C >= 1; --C) {
    for (ll A = 1; A <= sqrt(N - C); ++A) {
      if ((N - C) % A == 0) {
        ll B = (N - C) / A;
        count = A == B ? count + 1 : count + 2;
        // cout << A << ", " << B << ", " << C << endl;
        // ++count;
      }
    }
  }
  cout << count << endl;

  return 0;
}

#include <bits/stdc++.h>

using namespace std;
using ll = std::int_fast32_t;

#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)
map<ll, ll> prime;

void prime_factorize(ll n) {
  if (n <= 1)
    return;
  ll l = sqrt(n);
  FOR(i, 2, l) {
    if (n % i == 0) {
      prime_factorize(i);
      prime_factorize(ll(n / i));
      return;
    }
  }
  prime[n]++;
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll N;
  cin >> N;
  ll count{0};

  for (ll C = N - 1; C >= 1; --C) {
    ll i;
    prime_factorize(N - C);
    ll tmp = 1;
    for (const auto f : prime) {
      tmp *= f.second + 1;
    }
    prime.clear();
    count += tmp;
  }
  cout << count << endl;

  return 0;
}


#include <cmath>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 1; i < (n); i++)
using ll = long long;
using namespace std;

vector<ll> prime;

ll p(ll n) {
  int a = 2;
  ll count = 1;
  while (n >= a) {
    if (n % a == 0) {
      count++;
    }
    a++;
  }

  return count;
}

int main(int argc, const char *argv[]) {
  ll n;
  ll temp = 0;
  ll ans = 0;
  cin >> n;

  rep(i, n) {
    temp = p(n - i);
    ans += temp;
  }
  cout << ans << endl;

  return 0;
}

#include <cmath>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 1; i < (n); i++)
using ll = long long;
using namespace std;

vector<ll> prime;

int main(int argc, const char *argv[]) {
  int n;
  int temp = 0;
  int ans = 0;
  cin >> n;

  rep(i, n) {
    temp = (n - 1) / i;
    ans += temp;
  }
  cout << ans << endl;

  return 0;
}


#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

template <typename T>
std::ostream &operator<<(std::ostream &os, std::vector<T> &a) {
  os << "{";
  for (size_t i = 0; i < a.size(); ++i)
    os << (i > 0 ? "," : "") << a[i];
  return os << "}";
}

[[maybe_unused]] constexpr ll MOD = 1000000007;
[[maybe_unused]] constexpr int INF = 0x3f3f3f3f;
[[maybe_unused]] constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;

int main() {
  ll n;
  cin >> n;
  ll ans = 0;
  rep(c, 1, n) {
    ll ab = n - c;
    ll i = 1;
    while (i * i <= ab) {
      if (ab % i == 0) {
        if (ab / i == i)
          ++ans;
        else
          ans += 2;
      }
      ++i;
    }
  }
  cout << ans << endl;
  return 0;
}

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
using ll = int64_t;
#define rep(i, j, n) for (int i = j; i < (int)n; ++i)
#define rrep(i, j, n) for (int i = (int)n - 1; j <= i; --i)

template <typename T>
std::ostream &operator<<(std::ostream &os, std::vector<T> &a) {
  os << "{";
  for (size_t i = 0; i < a.size(); ++i)
    os << (i > 0 ? "," : "") << a[i];
  return os << "}";
}

[[maybe_unused]] constexpr ll MOD = 1000000007;
[[maybe_unused]] constexpr int INF = 0x3f3f3f3f;
[[maybe_unused]] constexpr ll INFL = 0x3f3f3f3f3f3f3f3fLL;

int main() {
  ll n;
  cin >> n;
  vector<ll> d(n + 1);
  rep(i, 1, n) {
    for (ll j = i; j < n; j += i)
      d[j]++;
  }

  ll ans = 0;
  rep(c, 1, n) ans += d[c];
  cout << ans << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int count = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (n - (i * j) > 0) {
        count++;
      }
    }
  }
  cout << count << endl;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int count = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n / i; j++) {
      if (n - (i * j) > 0) {
        count++;
      }
    }
  }
  cout << count << endl;
}


#include <iostream>

using namespace std;

int divisor(int n) {
  int res = 0;
  for (long long i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      ++res;
      if (i * i != n)
        ++res;
    }
  }
  return res;
}

int main() {
  int n;
  cin >> n;
  long long ans = 0;
  for (int c = 1; c < n; ++c) {
    int t = n - c;
    ans += divisor(t);
  }
  cout << ans << endl;

  return 0;
}

#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

vector<int> sieve(int n) {
  vector<int> res(n);
  iota(res.begin(), res.end(), 0);
  for (int i = 2; i * i < n; ++i) {
    if (res[i] < i)
      continue;
    for (int j = i * i; j < n; j += i)
      if (res[j] == j)
        res[j] = i;
  }
  return res;
}

int main() {
  int n;
  cin >> n;
  vector<int> si = sieve(n);
  long long ans = 1;
  for (int c = 1; c < n - 1; ++c) {
    int t = n - c;
    int res = 1, cnt = 0, prev = -1;
    while (t > 1) {
      if (prev == si[t] || prev == -1)
        ++cnt;
      else {
        res *= cnt + 1;
        cnt = 1;
      }
      prev = si[t];
      t /= si[t];
    }
    res *= cnt + 1;
    ans += res;
  }
  cout << ans << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1e9 + 7;

ll num_div(ll n) {
  ll cnt = 0;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i == 0)
      cnt += 2;
    if (n == i * i)
      cnt--;
  }
  return cnt;
}

int main() {
  ll n;
  cin >> n;
  ll ans = 0;
  for (ll c = 1; c < n; ++c) {
    ans += num_div(n - c);
    // cout<<ans<<endl;
  }
  cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1e9 + 7;

template <typename T> vector<T> smallest_prime_factors(T n) {
  // 1-indexedにできるようにする
  vector<T> spf(n + 1);
  // 最初は全て素数と仮定する．このとき最小の素因数はその数自身になるはず
  for (T i = 0; i <= n; i++)
    spf[i] = i;

  // ある素数の一定倍したものは必ず最小の素因数として元の素数を持つはず
  // これに従い，小さいほうから順に更新をかけていく
  for (T i = 2; i * i <= n; i++) {
    // iが素数の場合
    if (spf[i] == i) {
      // i以上の数でiを素因数に含むものを探し，最小の素因数を更新する
      // i*iより小さいものは必ずiよりも小さい素数ですでに更新されているはず
      for (T j = i * i; j <= n; j += i) {
        // まだ更新されていないものだけ更新する
        if (spf[j] == j)
          spf[j] = i;
      }
    }
  }
  return spf;
}

// 素因数分解
template <typename T> vector<T> factolization(T x, vector<T> &spf) {
  vector<T> ret;
  // 本来は2から順に割り切れるか試すが，すでに最小の素因数を得ているので，試す必要はない
  while (x != 1) {
    ret.push_back(spf[x]);
    x /= spf[x];
  }
  return ret;
}

ll num_div(ll n, vector<ll> &spf) {
  auto tmp = factolization(n, spf);
  map<ll, ll> mp;
  for (auto &&e : tmp) {
    mp[e]++;
  }
  ll ans = 1;
  for (auto &&e : mp) {
    ans *= (e.second + 1);
  }
  return ans;
}

int main() {
  auto spf = smallest_prime_factors(1000050LL);
  ll n, ans = 0;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    ans += num_div(n - i, spf);
  }
  cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int ans = 0;
  for (int c = 1; c < N; c++) {
    int tmp = N - c;
    for (int b = 1; b <= sqrt(tmp); b++) {
      if (tmp % b == 0) {
        if (b == sqrt(tmp)) {
          ans += 1;
        } else {
          ans += 2;
        }
      }
    }
  }

  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
  int N;
  cin >> N;
  int ans = 0;
  for (int c = 1; c < N; c++) {
    int tmp = N - c;
    float x = sqrt(tmp);

    for (int b = 1; b < x; b++) {
      if (tmp % b == 0)
        ans += 2;
    }

    if (floor(x) == x) {
      if (tmp % (int)x == 0)
        ans += 1;
    }
  }

  cout << ans << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\\'' << x << '\\''; }
void __print(const char *x) { cerr << '\\"' << x << '\\"'; }
void __print(const string &x) { cerr << '\\"' << x << '\\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V> void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T> void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x)
    cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\\n"; }
template <typename T, typename... V> void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v))
    cerr << ", ";
  _print(v...);
}
#ifndef ONLINE_JUDGE
#define debug(x...)                                                            \\
  cerr << "[" << #x << "] = [";                                                \\
  _print(x)
#else
#define debug(x...)
#endif
const long long INF = 1e18;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long cnt = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i * j < n)
        cnt++;
    }
  }
  cout << cnt << "\\n";
  return 0;
}
// https://www.youtube.com/watch?v=ZQqccia8bVo

#include <bits/stdc++.h>

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\\'' << x << '\\''; }
void __print(const char *x) { cerr << '\\"' << x << '\\"'; }
void __print(const string &x) { cerr << '\\"' << x << '\\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V> void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T> void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x)
    cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\\n"; }
template <typename T, typename... V> void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v))
    cerr << ", ";
  _print(v...);
}
#ifndef ONLINE_JUDGE
#define debug(x...)                                                            \\
  cerr << "[" << #x << "] = [";                                                \\
  _print(x)
#else
#define debug(x...)
#endif
const long long INF = 1e18;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long ans = 0;
  for (int i = 1; i < n; i++) {
    if (n % i == 0) {
      ans += n / i - 1;
    } else
      ans += n / i;
  }
  cout << ans;
  return 0;
}
// https://www.youtube.com/watch?v=ZQqccia8bVo


// AtCoder Beginner Contest 179 C.cpp

#include <iostream>
#include <string>
#include <vector>

using namespace std;

template <int size> struct arr {
  int sto[size];
  constexpr arr() {
    for (int64_t n = size - 1; n != 0; n--) {
      int64_t i, co;
      bool f = false;
      for (i = 1, co = 0; i * i <= n; i++) {
        if (i * i == n) {
          f = true;
        } else {
          if (n % i == 0) {
            co++;
          }
        }
      }
      sto[n] = (f ? co * 2 + 1 : co * 2);
    }
  }
};
arr<1000000> a;
int main() {
  int64_t n, an = 0;
  cin >> n;

  for (int i = 1; i < n; i++) {
    an += a.sto[i];
  }
  cout << an << endl;
}

// AtCoder Beginner Contest 179 C.cpp

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;

  int an = 0;
  for (int i = 1; i < n; i++) {
    an += (n - 1) / i;
  }

  cout << an << endl;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 1; j < n; j++) {
      if (i * j < n)
        cnt++;
    }
  }
  cout << cnt;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 1; i * j < n; j++) {

      cnt++;
    }
  }
  cout << cnt;
  return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define IOS                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define deb(x) cout << #x << "=" << x << endl;
#define endl '\\n'
#define M 1000000007
#define int long long
#define INF 1e18
#define N 1000005

using namespace std;

void solve() {
  ll n;
  cin >> n;
  ll ans = 0;
  for (int i = 1; i <= n - 1; ++i) {
    ll x = sqrt(n - i);
    for (int j = 1; j <= x; ++j) {
      if ((n - i) % j == 0) {
        if (j == (n - i) / j)
          ans++;
        else
          ans += 2;
      }
    }
  }
  cout << ans << endl;
}

int32_t main() {
  IOS ll T = 1;
  // cin >> T;
  for (ll i = 1; i <= T; ++i) {
    // cout<<"Case #"<<i<<": ";
    solve();
  }
  return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define IOS                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define deb(x) cout << #x << "=" << x << endl;
#define endl '\\n'
#define M 1000000007
#define int long long
#define INF 1e18
#define N 1000005

using namespace std;

void solve() {
  ll n;
  cin >> n;
  ll ans = 0;
  for (int i = 1; i <= n - 1; ++i) {
    for (int j = 1; j * i <= n - 1; ++j) {
      ans++;
    }
  }
  cout << ans << endl;
}

int32_t main() {
  IOS ll T = 1;
  // cin >> T;
  for (ll i = 1; i <= T; ++i) {
    // cout<<"Case #"<<i<<": ";
    solve();
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef long double ld;

int main() {
  ll N;
  cin >> N;
  ll ans = 0;
  for (ll i = 1; i <= N - 1; i++) {
    for (ll j = 1; j <= sqrt(N - i); j++) {
      if ((N - i) % j == 0 && (N - i) / j != j)
        ans += 2;
      else if ((N - i) % j == 0 && (N - i) / j == j)
        ans++;
    }
  }
  cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef long double ld;

int main() {
  ll N;
  cin >> N;
  ll ans = 0;
  for (int i = 1; i < N; i++) {
    ans += (N - 1) / i;
  }
  cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  int cou = 0;
  cin >> n;

  for (int a = 1; a < n; a++) {
    for (int b = 1; b < n; b++) {
      for (int c = 1; c < n; c++) {
        if (a * b + c == n) {
          cou++;
        }
      }
    }
  }
  cout << cou << endl;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  int cou = 0;
  cin >> n;

  for (int a = 1; a < n; a++) {
    for (int b = 1; b < n; b++) {
      if (a * b < n) {
        cou++;
      } else {
        break;
      }
    }
  }
  cout << cou << endl;
}


#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i * j < n) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n / i; j++) {
      if (i * j < n) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}


#include "bits/stdc++.h"

#define ll long long
#define ull unsigned long long
#define ld long double

#define tiii tuple<int, int, int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pci pair<char, int>
#define psi pair<string, int>
#define pis pair<int, string>

#define vi vector<int>
#define vd vector<double>
#define vld vector<ld>
#define vll vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vpi vector<pii>
#define vpll vector<pll>
#define vpis vector<pis>

#define pb push_back
#define mt make_tuple
#define gt0 get<0>
#define gt1 get<1>
#define gt2 get<2>

#define pi acos(-1)

#define fast                                                                   \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)

using namespace std;

const int maxn = 1e5 + 5;
const int mod = 1e9 + 9;

int main() {
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);

  fast;

  int n;

  scanf("%d", &n);

  ll ans = 0;

  for (int i = 1; i < n; i++) {
    int tmp = n - i;
    ll sum = 0;

    for (int j = 1; j * j <= tmp; j++) {
      if (tmp % j == 0) {
        if ((tmp / j) == j)
          sum++;
        else
          sum += 2;
      }
    }

    ans += sum;
  }

  printf("%lld\\n", ans);

  return 0;
}

#include "bits/stdc++.h"

#define ll long long
#define ull unsigned long long
#define ld long double

#define tiii tuple<int, int, int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pci pair<char, int>
#define psi pair<string, int>
#define pis pair<int, string>

#define vi vector<int>
#define vd vector<double>
#define vld vector<ld>
#define vll vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vpi vector<pii>
#define vpll vector<pll>
#define vpis vector<pis>

#define pb push_back
#define mt make_tuple
#define gt0 get<0>
#define gt1 get<1>
#define gt2 get<2>

#define pi acos(-1)

#define fast                                                                   \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)

using namespace std;

const int maxn = 1e6 + 5;
const int mod = 1e9 + 9;

int a[maxn];

void solve() {
  fill(a, a + maxn, 2);
  a[1] = 1;

  for (int i = 2; i < maxn; i++) {
    for (int j = i + i; j < maxn; j += i)
      a[j]++;
  }
}

int main() {
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);

  fast;

  solve();

  int n;

  scanf("%d", &n);

  ll ans = 0;

  for (int i = 1; i < n; i++) {
    int tmp = n - i;
    ans += a[tmp];
  }

  printf("%lld\\n", ans);

  return 0;
}


#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define inrange(a, x, b) (a <= x && x <= b)
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template <class T> void print(T x, bool cl = 1) {
  cout << (cl ? "\\x1b[36m" : "") << x << (cl ? "\\x1b[39m" : "") << '\\n';
}
template <class T> void print1d(T x, ll n = -1, bool cl = true) {
  if (n == -1)
    n = x.size();
  rep(i, 0, n) {
    cout << (cl ? "\\x1b[36m" : "") << x[i] << (i == n - 1 ? '\\n' : ' ');
  }
  cout << (cl ? "\\x1b[39m" : "");
}
template <class T> void print2d(T x, ll r = -1, ll c = -1, bool cl = 1) {
  if (r == -1)
    r = x.size();
  if (c == -1)
    c = x[0].size();
  rep(i, 0, r) print1d(x[i], c, cl);
}
template <class T, class U> bool haskey(T mp, U key) {
  return mp.find(key) != mp.end();
}
template <class T, class U> bool isin(T el, U container) {
  return find(all(container), el) != container.end();
}
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool even(T n) { return !(n & 1); }
template <class T> bool odd(T n) { return n & 1; }
template <class T> ll rup(T a, T b) { return a % b ? a / b + 1 : a / b; }
template <class T> ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template <class T> ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
ll intpow(ll a, ll n, ll _mod = numeric_limits<ll>::max()) {
  ll p = 1;
  while (n) {
    if (n & 1)
      p = p * a % _mod;
    a = a * a % _mod;
    n >>= 1;
  }
  return p;
}
ll modc(ll a, char op, ll b, ll _mod = mod) {
  a %= _mod;
  b %= _mod;
  ll res = 1;
  switch (op) {
  case '+':
    res = (a + b) % _mod;
    break;
  case '-':
    res = (a - b) % _mod;
    break;
  case '*':
    res = a * b % _mod;
    break;
  case '/':
    res = modc(a, '*', modc(b, '^', _mod - 2, _mod), _mod);
    break;
  case '^':
    res = intpow(a, b, _mod);
    break;
  case 'P':
    rep(i, a - b + 1, a + 1) res = modc(res, '*', i, _mod);
    break;
  case 'C':
    res = modc(modc(a, 'P', b, _mod), '/', modc(b, 'P', b, _mod));
    break;
  }
  if (res < 0) {
    res += _mod;
  }
  return res;
}

template <typename T> std::map<T, T> factorint(T n) {
  std::map<T, T> res;
  for (T i = 2; i * i <= n; ++i) {
    T counter = 0;
    while (n % i == 0) {
      n /= i;
      ++counter;
    }
    if (counter != 0) {
      res[i] = counter;
    }
  }
  if (n != 1) {
    res[n] = 1;
  }
  return res;
}

int main() {
  ll N;
  cin >> N;

  vll cnt(1010101);
  rep(i, 1, 1010101) {
    rep(j, 1, inf) {
      if (i * j > 1010100)
        break;
      cnt[i * j]++;
    }
  }

  ll ans = 0;
  // rep(a, 1, 1001) {
  //         //rep(b, 1, 1001) {
  //                 ll c = N - a*b;
  //                 if (c > 0) ++ans;
  //         //}
  // }

  rep(c, 1, 1000001) {
    ll p = N - c;
    // auto v = factorint(p);
    // ll sm = 1;
    // for (auto x : v) {
    //         sm *= x.second + 1;
    // }
    // ans += sm;
    ans += cnt[p];
  }

  cout << ans << endl;
}

#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define inrange(a, x, b) (a <= x && x <= b)
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template <class T> void print(T x, bool cl = 1) {
  cout << (cl ? "\\x1b[36m" : "") << x << (cl ? "\\x1b[39m" : "") << '\\n';
}
template <class T> void print1d(T x, ll n = -1, bool cl = true) {
  if (n == -1)
    n = x.size();
  rep(i, 0, n) {
    cout << (cl ? "\\x1b[36m" : "") << x[i] << (i == n - 1 ? '\\n' : ' ');
  }
  cout << (cl ? "\\x1b[39m" : "");
}
template <class T> void print2d(T x, ll r = -1, ll c = -1, bool cl = 1) {
  if (r == -1)
    r = x.size();
  if (c == -1)
    c = x[0].size();
  rep(i, 0, r) print1d(x[i], c, cl);
}
template <class T, class U> bool haskey(T mp, U key) {
  return mp.find(key) != mp.end();
}
template <class T, class U> bool isin(T el, U container) {
  return find(all(container), el) != container.end();
}
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool even(T n) { return !(n & 1); }
template <class T> bool odd(T n) { return n & 1; }
template <class T> ll rup(T a, T b) { return a % b ? a / b + 1 : a / b; }
template <class T> ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template <class T> ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
ll intpow(ll a, ll n, ll _mod = numeric_limits<ll>::max()) {
  ll p = 1;
  while (n) {
    if (n & 1)
      p = p * a % _mod;
    a = a * a % _mod;
    n >>= 1;
  }
  return p;
}
ll modc(ll a, char op, ll b, ll _mod = mod) {
  a %= _mod;
  b %= _mod;
  ll res = 1;
  switch (op) {
  case '+':
    res = (a + b) % _mod;
    break;
  case '-':
    res = (a - b) % _mod;
    break;
  case '*':
    res = a * b % _mod;
    break;
  case '/':
    res = modc(a, '*', modc(b, '^', _mod - 2, _mod), _mod);
    break;
  case '^':
    res = intpow(a, b, _mod);
    break;
  case 'P':
    rep(i, a - b + 1, a + 1) res = modc(res, '*', i, _mod);
    break;
  case 'C':
    res = modc(modc(a, 'P', b, _mod), '/', modc(b, 'P', b, _mod));
    break;
  }
  if (res < 0) {
    res += _mod;
  }
  return res;
}

template <typename T> std::map<T, T> factorint(T n) {
  std::map<T, T> res;
  for (T i = 2; i * i <= n; ++i) {
    T counter = 0;
    while (n % i == 0) {
      n /= i;
      ++counter;
    }
    if (counter != 0) {
      res[i] = counter;
    }
  }
  if (n != 1) {
    res[n] = 1;
  }
  return res;
}

int main() {
  ll N;
  cin >> N;

  vll cnt(1010101);
  rep(i, 1, 1010101) {
    rep(j, 1, inf) {
      if (i * j > 1010100)
        break;
      cnt[i * j]++;
    }
  }

  ll ans = 0;
  // rep(a, 1, 1001) {
  //         //rep(b, 1, 1001) {
  //                 ll c = N - a*b;
  //                 if (c > 0) ++ans;
  //         //}
  // }

  rep(c, 1, 1000001) {
    ll p = N - c;
    if (p < 0)
      continue;
    // auto v = factorint(p);
    // ll sm = 1;
    // for (auto x : v) {
    //         sm *= x.second + 1;
    // }
    // ans += sm;
    ans += cnt[p];
  }

  cout << ans << endl;
}


#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
int gcd(int a, int b) {
  if (a % b == 0) {
    return b;
  } else {
    return gcd(b, a % b);
  }
}

int main() {
  unsigned int N;
  unsigned int count = 0;
  unsigned int sq_count = 0;
  cin >> N;
  for (unsigned int i = 1; i < N; i++) {
    unsigned int n = N - i;
    for (unsigned int j = 1; j <= n; j++) {
      if (n % j == 0) {
        count++;
      }
    }
  }
  // count=(count-sq_count)*2+sq_count;
  cout << count << endl;
}

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;

int main() {
  unsigned int N;
  unsigned int count = 0;
  unsigned int sq_count = 0;
  cin >> N;

  for (int a = 1; a < N; a++) {
    count += (N - 1) / a;
  }
  cout << count << endl;
}


#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/

// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update>
//  find_by_order(k)  returns iterator to kth element starting from 0;
//  order_of_key(k) returns count of elements strictly smaller than k;
//  erase,insert same as normal set

#define ull unsigned long long int
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
#define ii pair<int, int>
#define vii vector<ii>
#define vi vector<int>
#define vl vector<ll>
#define mii map<int, int>
#define uii unordered_map<int, int>
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define fast_io                                                                \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define endl "\\n"
#define pb push_back
#define INF 1e18
#define print(x) cout << x << "\\n";
#define scanv(v, n)                                                            \\
  for (int i = 0; i < n; i++)                                                  \\
    cin >> v[i];
#define printv(v)                                                              \\
  for (auto it : v)                                                            \\
    cout << it << " ";
#define rall(v) v.rbegin(), v.rend()

// #include<boost/multiprecision/cpp_int.hpp>
//(Uncomment when needed and be sure it not give TLE bcoz it requires time)
// #pragma GCC optimize "trapv"//to check integer overflow and gives RE.
// typedef tree<pair<int,int>,null_type,
// less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>
// ordered_set; (UNCOMMENT WHEN HAVING LOTS OF RECURSIONS) #pragma
// comment(linker, "/stack:200000000") (UNCOMMENT WHEN NEEDED) #pragma GCC
// optimize("Ofast,unroll-loops,no-stack-protector,fast-math") #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC
// optimize("O3") uncoment for large int requirement using
// boost::multiprecision::cpp_int;
template <typename T> struct FenwickTree {
  T N;
  vector<int> tree;

  void init(int n) {
    N = n;
    tree.assign(n + 1, 0);
  }

  void update(int idx, T val) {
    while (idx <= N) {
      tree[idx] += val;
      idx += idx & -idx;
    }
  }

  void updateMax(int idx, T val) {
    while (idx <= N) {
      tree[idx] = max(tree[idx], val);
      idx += idx & -idx;
    }
  }

  T pref(int idx) {
    T ans = 0;
    while (idx > 0) {
      ans += tree[idx];
      idx -= idx & -idx;
    }
    return ans;
  }

  T rsum(int l, int r) { return pref(r) - pref(l - 1); }

  T prefMax(int idx) {
    T ans = -2e9;
    while (idx > 0) {
      ans = max(ans, tree[idx]);
      idx -= idx & -idx;
    }
    return ans;
  }
};
//~ const int MAXN = 1e6+10;
//~ std::vector <int> prime;
//~ bool is_composite[MAXN];

//~ void sieve (int n) {
//~ std::fill (is_composite, is_composite + n, false);
//~ for (int i = 2; i < n; ++i) {
//~ if (!is_composite[i]) prime.push_back (i);
//~ for (int j = 0; j < (int)prime.size () && i * prime[j] < n; ++j) {
//~ is_composite[i * prime[j]] = true;
//~ if (i % prime[j] == 0) break;
//~ }
//~ }
//~ }

ll stoii(string s) {
  ll ans = 0;
  for (auto it : s) {
    ll cur = it - '0';
    ans = ans * 10 + cur;
  }
  return ans;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }

  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
// use it with unordered_map<T,T,custom_hash> safe_map
const long long int MOD = 1e9 + 7;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
const long long int N = 1e5;

int main() {
  fast_io
      /*#ifndef ONLINE_JUDGE
      freopen("inputa.txt","r",stdin);
      freopen("outputa.txt","w",stdout);
      #endif
  */ int t;
  t = 1;

  // cin>>t;
  while (t--) {
    ll n;
    cin >> n;
    ll ans = 0;
    for (ll i = 1; i <= n; i++) {
      ll tmp = n - i;
      for (ll i = 1; i * i <= tmp; i++) {
        if (tmp % i == 0) {
          ans += 2;
          if (tmp / i == i)
            ans--;
        }
      }
    }
    cout << ans << endl;
  }
}

#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/

// #define ordered_set tree<int, null_type,less<int>,
// rb_tree_tag,tree_order_statistics_node_update>
//  find_by_order(k)  returns iterator to kth element starting from 0;
//  order_of_key(k) returns count of elements strictly smaller than k;
//  erase,insert same as normal set

#define ull unsigned long long int
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
#define ii pair<int, int>
#define vii vector<ii>
#define vi vector<int>
#define vl vector<ll>
#define mii map<int, int>
#define uii unordered_map<int, int>
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define fast_io                                                                \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define endl "\\n"
#define pb push_back
#define INF 1e18
#define print(x) cout << x << "\\n";
#define scanv(v, n)                                                            \\
  for (int i = 0; i < n; i++)                                                  \\
    cin >> v[i];
#define printv(v)                                                              \\
  for (auto it : v)                                                            \\
    cout << it << " ";
#define rall(v) v.rbegin(), v.rend()

// #include<boost/multiprecision/cpp_int.hpp>
//(Uncomment when needed and be sure it not give TLE bcoz it requires time)
// #pragma GCC optimize "trapv"//to check integer overflow and gives RE.
// typedef tree<pair<int,int>,null_type,
// less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>
// ordered_set; (UNCOMMENT WHEN HAVING LOTS OF RECURSIONS) #pragma
// comment(linker, "/stack:200000000") (UNCOMMENT WHEN NEEDED) #pragma GCC
// optimize("Ofast,unroll-loops,no-stack-protector,fast-math") #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #pragma GCC
// optimize("O3") uncoment for large int requirement using
// boost::multiprecision::cpp_int;
template <typename T> struct FenwickTree {
  T N;
  vector<int> tree;

  void init(int n) {
    N = n;
    tree.assign(n + 1, 0);
  }

  void update(int idx, T val) {
    while (idx <= N) {
      tree[idx] += val;
      idx += idx & -idx;
    }
  }

  void updateMax(int idx, T val) {
    while (idx <= N) {
      tree[idx] = max(tree[idx], val);
      idx += idx & -idx;
    }
  }

  T pref(int idx) {
    T ans = 0;
    while (idx > 0) {
      ans += tree[idx];
      idx -= idx & -idx;
    }
    return ans;
  }

  T rsum(int l, int r) { return pref(r) - pref(l - 1); }

  T prefMax(int idx) {
    T ans = -2e9;
    while (idx > 0) {
      ans = max(ans, tree[idx]);
      idx -= idx & -idx;
    }
    return ans;
  }
};
//~ const int MAXN = 1e6+10;
//~ std::vector <int> prime;
//~ bool is_composite[MAXN];

//~ void sieve (int n) {
//~ std::fill (is_composite, is_composite + n, false);
//~ for (int i = 2; i < n; ++i) {
//~ if (!is_composite[i]) prime.push_back (i);
//~ for (int j = 0; j < (int)prime.size () && i * prime[j] < n; ++j) {
//~ is_composite[i * prime[j]] = true;
//~ if (i % prime[j] == 0) break;
//~ }
//~ }
//~ }

ll stoii(string s) {
  ll ans = 0;
  for (auto it : s) {
    ll cur = it - '0';
    ans = ans * 10 + cur;
  }
  return ans;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }

  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
// use it with unordered_map<T,T,custom_hash> safe_map
const long long int MOD = 1e9 + 7;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
const long long int N = 1e5;

int main() {
  fast_io
      /*#ifndef ONLINE_JUDGE
      freopen("inputa.txt","r",stdin);
      freopen("outputa.txt","w",stdout);
      #endif*/
      int t;
  t = 1;

  // cin>>t;
  while (t--) {
    ll n;
    cin >> n;
    ll ans = 0;
    for (ll i = 1; i <= n; i++) {
      ll j = 0;
      while (1) {
        j++;
        if (i * j >= n)
          break;
        ans++;
      }
    }
    cout << ans << endl;
  }
}


#include <iostream>
#include <string>
#include <vector>

int main() {
  int n;
  std::cin >> n;

  bool over = false;
  int count = 0;
  for (int c = 1; c < n; c++) {
    // std::cout << c << std::endl;
    for (int a = 1; a < n; a++) {
      for (int b = a; b < n; b++) {
        // std::cout << a << ":" << b << std::endl;
        if (a * b > n - c) {
          break;
        }
        if (a * b == n - c) {
          if (a == b) {
            count++;
          } else {
            count += 2;
          }
        }
      }
    }
  }
  std::cout << count << std::endl;
}

#include <iostream>
#include <string>
#include <vector>

int main() {
  int n;
  std::cin >> n;
  int count = 0;
  for (int a = 1; a < n; a++) {
    for (int b = 1; b <= (n - 1) / a; b++) {
      count += 1;
    }
  }
  std::cout << count << std::endl;
}


#include <stdio.h>
int main() {
  int a, b, c, cnt; // 制御変数
  int n;
  scanf("%d", &n);
  cnt = 0;

  for (a = 1; a < n; a++) {
    for (b = 1; b < n; b++) {
      if (a * b >= n)
        continue;
      // cの期待値を求める
      c = n - a * b;
      if (c > 0) { // cは0以上
        cnt++;
      }
    }
  }
  printf("%d", cnt);
}

#include <stdio.h>
int main() {
  int a, b, c, cnt; // 制御変数
  int n;
  scanf("%d", &n);
  cnt = 0;

  for (a = 1; a < n; a++) {
    for (b = 1; b < n; b++) {
      if (a * b >= n)
        break;
      // cの期待値を求める
      c = n - a * b;
      if (c > 0) { // cは0以上
        cnt++;
      }
    }
  }
  printf("%d", cnt);
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set                                                            \\
  tree<pairs, null_type, greater<pairs>, rb_tree_tag,                          \\
       tree_order_statistics_node_update>
#define ll long long
#define lld long double
#define vc vector<ll>
const ll MOD = (1e9 + 7);
typedef pair<ll, ll> pairs;
ll power(ll a, ll b) {
  ll res = 1;
  a = a % MOD;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % MOD;
      b--;
    }
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
ll fact(ll n) {
  ll i, cnt = 0, temp, ans = 1;
  ;
  while (n % 2 == 0) {
    n /= 2;
    cnt++;
  }
  temp = n;
  ans *= cnt + 1;
  for (i = 3; i * i <= temp; i += 2) {
    cnt = 0;
    while (n % i == 0) {
      n /= i;
      cnt++;
    }
    ans *= cnt + 1;
  }
  if (n > 2)
    ans *= 2;
  return ans;
}
int main() {
  // your code goes here
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll t, n, i, j, k, c, f, ans = 0;
  cin >> n;
  for (i = 1; i < n; i++) {
    ans += fact(n - i);
  }
  cout << ans;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set                                                            \\
  tree<pairs, null_type, greater<pairs>, rb_tree_tag,                          \\
       tree_order_statistics_node_update>
#define ll long long
#define lld long double
#define vc vector<ll>
const ll MOD = (1e9 + 7);
typedef pair<ll, ll> pairs;
ll power(ll a, ll b) {
  ll res = 1;
  a = a % MOD;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % MOD;
      b--;
    }
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
ll fact(ll n) {
  ll i, cnt = 0, temp, ans = 1;
  ;
  while (n % 2 == 0) {
    n /= 2;
    cnt++;
  }
  temp = n;
  ans *= cnt + 1;
  for (i = 3; i * i <= temp; i += 2) {
    cnt = 0;
    while (n % i == 0) {
      n /= i;
      cnt++;
    }
    ans *= cnt + 1;
  }
  if (n > 2)
    ans *= 2;
  return ans;
}
int main() {
  // your code goes here
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll t, n, i, j, k, c, f, ans = 0;
  cin >> n;
  vc num(n + 1);
  for (i = 1; i < n; i++) {
    for (j = i; j < n; j += i)
      num[j]++;
  }
  for (i = 1; i < n; i++) {
    ans += num[n - i];
  }
  cout << ans;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int g = 0;
  int n;
  cin >> n;
  for (int64_t a = 1; a < 1000000; a++) {
    for (int64_t b = 1; b < 1000000; b++) {
      for (int64_t c = 1; c < 1000000; c++) {
        if (a * b + c == n) {
          g++;
        }
      }
    }
  }
  cout << g << endl;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int cou = 0;
  int n;
  cin >> n;
  int a = 1;
  int b = 1;
  while (1) {
    if (a > n) {
      break;
    }
    int b = 1;
    while (1) {
      if (n > a * b) {
        cou++;
      } else if (n <= a * b) {
        break;
      }
      b++;
    }
    a++;
  }

  cout << cou << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, k;
  cin >> n >> k;
  vector<int> s, dp(n + 1);

  for (int i = 0; i < k; i++) {
    int l, r;
    cin >> l >> r;
    while (l <= r) {
      s.push_back(l);
      l++;
    }
  }

  /*
  for(int j:s){
          cout<<j<<' ';
  }
  cout<<'\\n';
  */
  dp[1] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j : s) {
      if (i + j <= n) {
        dp[i + j] = (dp[i + j] + dp[i]) % mod;
      }
    }
  }
  cout << dp[n] << '\\n';
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 998244353;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n, k;
  cin >> n >> k;
  vector<pair<int, int>> s;
  vector<int> dp(2 * n + 5);

  for (int i = 0; i < k; i++) {
    int l, r;
    cin >> l >> r;
    s.push_back({l, r});
  }

  /*
  for(int j:s){
          cout<<j<<' ';
  }
  cout<<'\\n';
  */
  dp[1] = 1;
  for (int i = 1; i <= n; i++) {
    dp[i] = (dp[i - 1] + dp[i]) % mod;
    for (int j = 0; j < k; j++) {
      int l = s[j].first, r = s[j].second;

      dp[i + l] = (dp[i] + dp[i + l]) % mod;
      dp[i + r + 1] = (dp[i + r + 1] - dp[i]) % mod;
    }
  }
  ll ans = (dp[n] - dp[n - 1] + mod) % mod;
  cout << ans << '\\n';

  return 0;
}


// clear adj and visited vector declared globally after each test case
// check for long long overflow
// while adding and subs check if mod becomes -ve
// while using an integer directly in a builtin function add ll
// Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
// Dont keep array name as size or any other key word

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define IOS                                                                    \\
  std::ios::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);                                                              \\
  cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 998244353ll
#define lld long double
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rep(i, x, y) for (int i = x; i < y; i++)
#define fill(a, b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp, n, m)                                                      \\
  for (int i = 0; i <= n; i++) {                                               \\
    for (int j = 0; j <= m; j++)                                               \\
      cout << dp[i][j] << " ";                                                 \\
    cout << "\\n";                                                              \\
  }
typedef std::numeric_limits<double> dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    indexed_set;
const long long N = 100005, INF = 2000000000000000000;
lld pi = 3.1415926535897932;
int lcm(int a, int b) {
  int g = __gcd(a, b);
  return a / g * b;
}
int power(int a, int b, int p) {
  if (a == 0)
    return 0;
  int res = 1;
  a %= p;
  while (b > 0) {
    if (b & 1)
      res = (res * a) % p;
    b >>= 1;
    a = (a * a) % p;
  }
  return res;
}
int dp[N], ans[N];
int32_t main() {
  IOS;
  int n, k;
  cin >> n >> k;
  int l[k], r[k];
  for (int i = 0; i < k; i++)
    cin >> l[i] >> r[i];
  dp[0] = 1;
  ans[0] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < k; j++) {
      int m1 = i - r[j], m2 = i - l[j];
      if (m2 >= 0)
        ans[i] = (ans[i] + dp[m2]) % mod;
      m1--;
      if (m1 >= 0)
        ans[i] = (ans[i] - dp[m1] + mod) % mod;
    }
    dp[i] = (dp[i - 1] + ans[i]) % mod;
  }
  cout << ans[n - 1];
}

// clear adj and visited vector declared globally after each test case
// check for long long overflow
// while adding and subs check if mod becomes -ve
// while using an integer directly in a builtin function add ll
// Mod wale question mein last mein if dalo ie. Ans<0 then ans+=mod;
// Dont keep array name as size or any other key word

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define IOS                                                                    \\
  std::ios::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);                                                              \\
  cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 998244353ll
#define lld long double
#define mii map<int, int>
#define mci map<char, int>
#define msi map<string, int>
#define pii pair<int, int>
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rep(i, x, y) for (int i = x; i < y; i++)
#define fill(a, b) memset(a, b, sizeof(a))
#define vi vector<int>
#define setbits(x) __builtin_popcountll(x)
#define print2d(dp, n, m)                                                      \\
  for (int i = 0; i <= n; i++) {                                               \\
    for (int j = 0; j <= m; j++)                                               \\
      cout << dp[i][j] << " ";                                                 \\
    cout << "\\n";                                                              \\
  }
typedef std::numeric_limits<double> dbl;
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    indexed_set;
const long long N = 200005, INF = 2000000000000000000;
lld pi = 3.1415926535897932;
int lcm(int a, int b) {
  int g = __gcd(a, b);
  return a / g * b;
}
int power(int a, int b, int p) {
  if (a == 0)
    return 0;
  int res = 1;
  a %= p;
  while (b > 0) {
    if (b & 1)
      res = (res * a) % p;
    b >>= 1;
    a = (a * a) % p;
  }
  return res;
}
int dp[N], ans[N];
int32_t main() {
  IOS;
  int n, k;
  cin >> n >> k;
  int l[k], r[k];
  for (int i = 0; i < k; i++)
    cin >> l[i] >> r[i];
  dp[0] = 1;
  ans[0] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < k; j++) {
      int m1 = i - r[j], m2 = i - l[j];
      if (m2 >= 0)
        ans[i] = (ans[i] + dp[m2]) % mod;
      m1--;
      if (m1 >= 0)
        ans[i] = (ans[i] - dp[m1] + mod) % mod;
    }
    dp[i] = (dp[i - 1] + ans[i]) % mod;
  }
  cout << ans[n - 1];
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1000000007;
void files() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}

int main() {
  fast();
  ll n, k, d1, d2, m = 998244353;
  cin >> n >> k;
  set<ll> s;
  for (int i = 0; i < k; i++) {
    cin >> d1 >> d2;
    for (int j = d1; j <= d2; j++) {
      s.insert(j);
    }
  }
  ll dp[n + 1];
  memset(dp, 0, sizeof dp);
  dp[1] = 1;
  set<ll>::iterator it;
  for (ll i = 1; i < n; i++) {
    for (it = s.begin(); it != s.end(); it++) {
      if (*it + i <= n) {
        dp[*it + i] = dp[*it + i] + dp[i];
        dp[*it + i] = dp[i + *it] % m;
      } else {
        break;
      }
    }
  }
  cout << dp[n];

  return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long int
#define ull unsigned long long int
#define forr(i, n) for (int i = 0; i < n; i++)
#define f(i, a, b) for (ll i = a; i < b; i++)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define endl '\\n'
#define ce(ele) cout << ele << ' '
#define cs(ele) cout << ele << '\\n'
#define CASE(t)                                                                \\
  int t;                                                                       \\
  cin >> t;                                                                    \\
  while (t--)
#define sor(v) sort(v.begin(), v.end())
#define rev(v) reverse(v.begin(), v.end())
#define vi vector<ll>
const ll md = 1e9 + 7;
const ll M1 = 998244353;
ll mod(ll n) { return ((n % M1) + M1) % M1; }
ll power(ll x, ll y) {
  ll res = 1;
  x = x;
  while (y > 0) {
    if (y & 1)
      res = res * x;
    x = x * x;
    y = y >> 1;
  }
  return res;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  ll n, k;
  cin >> n >> k;
  vector<pair<ll, ll>> v(k);
  f(i, 0, k) cin >> v[i].F >> v[i].S;

  vi dp(n + 1, 0);
  dp[0] = 0, dp[1] = 1;
  f(i, 2, n + 1) {
    ll cur = 0;
    f(j, 0, k) {
      if (v[j].F >= i)
        continue;
      ll l = max(1LL, i - v[j].S);
      ll r = i - v[j].F;
      cur += dp[r] - dp[l - 1];
    }
    cur = mod(cur);
    dp[i] = mod(dp[i - 1] + cur);
  }
  cs(mod(dp[n] - dp[n - 1]));
  // f(i,1,n+1)cs(dp[i]);
}


#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18
typedef long long ll;

const int MOD = 998244353;

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> L(K), R(K);
  REP(i, K) { cin >> L[i] >> R[i]; }
  vector<ll> dp(N + 1, 0);
  dp[0] = 1;

  REP(i, N - 1) {
    if (i != 0)
      dp[i] += dp[i - 1];
    dp[i] = (dp[i] + MOD) % MOD;
    REP(k, K) {
      if (i + L[k] <= N - 1) {
        dp[i + L[k]] += dp[i];
        dp[i + L[k]] = (dp[i + L[k]] + MOD) % MOD;
      }
      if (i + R[k] + 1 <= N - 1)
        dp[i + R[k] + 1] -= dp[i];
      dp[i + R[k] + 1] = (dp[i + R[k] + 1] + MOD) % MOD;
    }
    // REP(i,N){
    //     cout << dp[i] << " ";
    // }
    // cout << endl;
  }
  cout << (dp[N - 1] + MOD) % MOD << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18
typedef long long ll;

const int MOD = 998244353;

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> L(K), R(K);
  REP(i, K) { cin >> L[i] >> R[i]; }
  vector<ll> dp(N + 1, 0);
  dp[0] = 1;

  REP(i, N - 1) {
    if (i != 0)
      dp[i] += dp[i - 1];
    dp[i] = (dp[i] + MOD) % MOD;
    REP(k, K) {
      if (i + L[k] <= N - 1) {
        dp[i + L[k]] += dp[i];
        dp[i + L[k]] = (dp[i + L[k]] + MOD) % MOD;
      }
      if (i + R[k] + 1 <= N - 1) {
        dp[i + R[k] + 1] -= dp[i];
        dp[i + R[k] + 1] = (dp[i + R[k] + 1] + MOD) % MOD;
      }
    }
    // REP(i,N){
    //     cout << dp[i] << " ";
    // }
    // cout << endl;
  }
  cout << (dp[N - 1] + MOD) % MOD << endl;
  return 0;
}


#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000
typedef pair<ll, ll> pll;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N, K;
  cin >> N >> K;
  vector<ll> S;
  ll MOD = 998244353;
  rep(i, K) {
    ll a, b;
    cin >> a >> b;
    for (int j = a; j <= b; j++) {
      S.push_back(j);
    }
  }

  vector<ll> dp(N + 5, 0);
  dp[1] = 1;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < S.size(); j++) {
      if (S[j] + i <= N) {
        dp[S[j] + i] += dp[i];
        dp[S[j] + i] %= MOD;
      }
    }
  }

  cout << dp[N] << endl;

  return 0;
}

#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000
typedef pair<ll, ll> pll;

template <int MOD> struct Fp {
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
    if (val < 0)
      v += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator-() const noexcept { return val ? MOD - val : 0; }
  constexpr Fp operator+(const Fp &r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator-(const Fp &r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator*(const Fp &r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator/(const Fp &r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp &operator+=(const Fp &r) noexcept {
    val += r.val;
    if (val >= MOD)
      val -= MOD;
    return *this;
  }
  constexpr Fp &operator-=(const Fp &r) noexcept {
    val -= r.val;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr Fp &operator*=(const Fp &r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp &operator/=(const Fp &r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr bool operator==(const Fp &r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator!=(const Fp &r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream &operator<<(ostream &os, const Fp<MOD> &x) noexcept {
    return os << x.val;
  }
  friend constexpr istream &operator>>(istream &is, Fp<MOD> &x) noexcept {
    return is >> x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
    if (n == 0)
      return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1)
      t = t * a;
    return t;
  }
};

const int MOD = 998244353;
using mint = Fp<MOD>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N, K;
  cin >> N >> K;
  vector<int> L(K), R(K);
  vector<mint> dp(N, 0), sdp(N + 1, 0);
  dp[0] = 1, sdp[1] = 1;
  rep(i, K) { cin >> L[i] >> R[i]; }

  // 累積和しながらdp
  for (int i = 1; i < N; i++) {
    rep(j, K) {
      int l = max(0, i - R[j]);
      int r = max(0, i - L[j] + 1);
      dp[i] += sdp[r] - sdp[l];
      // iに飛ぶ連続した区間の累積和
    }
    sdp[i + 1] = sdp[i] + dp[i];
    // 累積和も更新
  }

  cout << dp[N - 1] << endl;
}


#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main() {
  ll n, k, l, r, i, j, mod = 998244353;
  set<ll> s;
  cin >> n >> k;
  vector<ll> dp(n);
  for (i = 0; i < k; i++) {
    cin >> l >> r;
    for (j = l; j <= r; j++)
      s.insert(j);
  }
  dp[0] = 1;
  for (i = 1; i < n; i++) {
    for (auto x : s) {
      if (x <= i)
        dp[i] = (dp[i] + dp[i - x]) % mod;
      else
        break;
    }
  }
  cout << dp[n - 1] << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
const ll M = 998244353;
int si[] = {-1, 0, 1, 0};
int sj[] = {0, -1, 0, 1};

int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> l(k), r(k);
  vector<ll> s;
  rep(i, k) {
    cin >> l[i] >> r[i];
    rep(j, r[i] - l[i] + 1) s.push_back(l[i] + j);
  }

  vector<ll> dp(n + 1, 0);
  dp[1] = 1;
  for (int i = 1; i <= n; i++) {
    auto itr = s.begin();
    rep(j, s.size()) {
      if (i - *itr > 0)
        dp[i] += dp[i - *itr];
      dp[i] %= M;
      itr++;
    }
  }

  cout << dp[n] % M << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
const ll M = 998244353;
int si[] = {-1, 0, 1, 0};
int sj[] = {0, -1, 0, 1};

int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> l(k), r(k);
  rep(i, k) cin >> l[i] >> r[i];

  vector<ll> dp(n + 1, 0);
  vector<ll> dpsum(n + 1, 0);
  dp[1] = 1;
  dpsum[1] = 1;
  for (int i = 2; i <= n; i++) {
    rep(j, k) {
      int li = i - r[j];
      int ri = i - l[j];
      if (ri < 0)
        continue;
      li = max(li, 1);
      dp[i] += dpsum[ri] - dpsum[li - 1];
      dp[i] += M;
      dp[i] %= M;
    }
    dpsum[i] = dpsum[i - 1] + dp[i];
    dpsum[i] %= M;
  }

  dp[n] += M;
  cout << dp[n] % M << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
ll lcm(ll x, ll y) {
  return x / GCD(x, y) *
         y; // 先に割り算をして掛けられる数を小さくして掛け算を行う
}
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
long long COM(int n, int k) {
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> L(K), R(K), dp(N + 100);
  set<int> s;
  for (int i = 0; i < K; i++) {
    cin >> L[i] >> R[i];
  }
  for (int i = 0; i < K; i++) {
    for (int j = L[i]; j <= R[i]; j++) {
      s.insert(j);
    }
  }
  dp[1] = 1;
  for (int i = 1; i <= N; i++) {
    for (auto d : s) {
      if (i + d <= N) {
        dp[i + d] += dp[i];
        dp[i + d] %= 998244353;
      }
    }
  }

  cout << dp[N] << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
ll lcm(ll x, ll y) {
  return x / GCD(x, y) *
         y; // 先に割り算をして掛けられる数を小さくして掛け算を行う
}
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
long long COM(int n, int k) {
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
  int N, K;
  cin >> N >> K;
  vector<ll> dp(N + 100), sdp(N + 100);
  vector<int> L(K), R(K);
  ll mod = 998244353;
  for (int i = 0; i < K; i++) {
    cin >> L[i] >> R[i];
  }

  dp[1] = 1;
  sdp[1] = 1;
  for (int j = 2; j <= N; j++) {
    for (int i = 0; i < K; i++) {
      int right = max(0, j - L[i]);
      int left = max(0, j - R[i] - 1);
      dp[j] += sdp[right] - sdp[left] + mod;
      // cout << left << " " << right << endl;
      dp[j] %= mod;
    }
    dp[j] %= mod;
    sdp[j] = sdp[j - 1] + dp[j];
    sdp[j] %= mod;
  }

  cout << dp[N] << endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

const int mod = 998244353;

int main() {
  int n, k;
  cin >> n >> k;
  vector<P> ran(k);
  rep(i, k) cin >> ran[i].first >> ran[i].second;

  vector<ll> dp(n + 1);
  vector<ll> s(n + 1);
  dp[0] = 1;
  s[1] = 1;
  for (int i = 1; i <= n; ++i) {
    rep(j, k) {
      int li = i - ran[j].second;
      int ri = i - ran[j].first;
      if (ri < 0)
        continue;
      li = max(li, 0);
      (dp[i] += s[ri + 1] - s[li]) %= mod;
    }
    s[i + 1] = s[i] + dp[i];
  }

  cout << dp[n - 1] % mod << endl;
  return 0;
}

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

const int mod = 998244353;

int main() {
  int n, k;
  cin >> n >> k;
  vector<P> ran(k);
  rep(i, k) cin >> ran[i].first >> ran[i].second;

  vector<ll> dp(n + 1);
  vector<ll> s(n + 2);
  dp[0] = 1;
  s[1] = 1;
  for (int i = 1; i <= n; ++i) {
    rep(j, k) {
      int li = i - ran[j].second;
      int ri = i - ran[j].first;
      if (ri < 0)
        continue;
      li = max(li, 0);
      (dp[i] += s[ri + 1] - s[li] + mod) %= mod;
    }
    s[i + 1] = (s[i] + dp[i]) % mod;
  }

  cout << dp[n - 1] % mod << endl;
  return 0;
}


#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>

int main() {
  int N, K;
  std::cin >> N >> K;
  std::vector<int> S;
  S.reserve(N);
  for (int i = 0; i < K; ++i) {
    int L, R;
    std::cin >> L >> R;
    for (int j = L; j <= R; ++j) {
      S.push_back(j);
    }
  }
  std::sort(S.begin(), S.end());

  std::vector<int64_t> memo(N + 1);
  memo[N] = 1;
  for (int pos = N - 1; pos >= 1; --pos) {
    int64_t count = 0;
    for (auto itr = S.begin(); itr != S.end(); ++itr) {
      const int pos_move = pos + *itr;
      if (pos_move > N) {
        break;
      }
      count += memo[pos_move];
    }
    memo[pos] = count % 998244353;
  }
  std::cout << memo[1] << std::endl;
  return 0;
}

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>

int main() {
  int N, K;
  std::cin >> N >> K;
  typedef std::pair<int, int> RANGE;
  std::vector<RANGE> LR(K);
  for (int i = 0; i < K; ++i) {
    std::cin >> LR[i].first >> LR[i].second;
  }

  std::vector<int64_t> memo(N + 1);
  std::vector<int64_t> sum(N + 1);
  memo[N] = 1;
  sum[N] = 1;
  for (int pos = N - 1; pos >= 1; --pos) {
    int64_t count = 0;
    for (auto itr = LR.begin(); itr != LR.end(); ++itr) {
      const int begin_pos = pos + itr->first;
      if (begin_pos > N) {
        continue;
      }
      const int end_pos = pos + itr->second + 1;
      const int64_t begin_value = sum[begin_pos];
      const int64_t end_value = (end_pos > N) ? 0 : sum[end_pos];
      count += begin_value - end_value;
    }
    memo[pos] = count % 998244353;
    sum[pos] = sum[pos + 1] + memo[pos];
  }
  std::cout << memo[1] << std::endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(), v.end()
ll mod = 998244353;
vector<ll> note;
ll N, K;
vector<ll> vec;

ll dp(ll i) {
  if (note[i - 1] >= 0) {
    return note[i - 1];
  }

  ll s = 0;
  ll j = 0;
  while (j < vec.size()) {
    if (i + vec[j] > N) {
      break;
    }
    s += dp(i + vec[j]);
    s %= mod;
    j++;
  }

  note[i - 1] = s;
  return s;
}

int main() {

  cin >> N >> K;
  note = vector<ll>(N, -1);
  note[N - 1] = 1;

  vec = vector<ll>(0);
  vector<pair<ll, ll>> A(K);
  for (ll i = 0; i < K; i++) {
    ll L, R;
    cin >> L >> R;
    A[i] = make_pair(L, R);
  }
  sort(all(A));

  for (ll i = 0; i < K; i++) {
    ll L, R;
    tie(L, R) = A[i];
    for (ll j = L; j <= R; j++) {
      vec.push_back(j);
    }
  }

  cout << dp(1) << endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(), v.end()

int main() {
  ll mod = 998244353;
  ll N, K;
  cin >> N >> K;
  vector<pair<ll, ll>> vec(K);
  for (ll i = 0; i < K; i++) {
    ll L, R;
    cin >> L >> R;
    vec[i] = make_pair(L, R);
  }
  sort(all(vec));
  vector<ll> dp(N, 0);

  for (ll i = N - 2; i >= 0; i--) {

    dp[i] = dp[i + 1];
    dp[i] %= mod;
    for (ll j = 0; j < K; j++) {
      ll A, B;
      tie(A, B) = vec[j];
      if (i + A > N - 1) {
        break;
      }
      if (i + A == N - 1) {
        dp[i]++;
      } else {

        dp[i] += dp[i + A];
        dp[i] %= mod;
      }

      if (i + B + 1 > N - 1) {
        break;
      }
      if (i + B + 1 == N - 1) {
        dp[i]--;
      } else {

        dp[i] -= dp[i + B + 1];
        dp[i] %= mod;
      }
    }
  }
  if (dp[0] < 0) {
    while (dp[0] < 0) {
      dp[0] += mod;
    }
  }
  cout << dp[0] << endl;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(c) begin(c), end(c)
#define PI acos(-1)
#define oo LLONG_MAX
template <typename T1, typename T2> bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T1, typename T2> bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return true;
  } else
    return false;
}
/*
N^2は無理

*/
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);

  vector<ll> pos(400010, 0);
  vector<ll> jump;
  ll N, K, MOD = 998244353;
  cin >> N >> K;
  rep(i, K) {
    ll L, R;
    cin >> L >> R;
    while (L <= R) {
      jump.push_back(L);
      L++;
    }
  }
  pos[200001] = 1;
  ll sz = jump.size();
  for (ll i = 2; i <= N; i++) {
    rep(j, sz) { (pos[200000 + i] += pos[200000 + i - jump[j]]) %= MOD; }
  }
  cout << pos[200000 + N] << endl;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(c) begin(c), end(c)
#define PI acos(-1)
#define oo LLONG_MAX
template <typename T1, typename T2> bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T1, typename T2> bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return true;
  } else
    return false;
}
/*
N^2は無理

*/
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);

  vector<ll> pos(400010, 0), sum(400010, 0);
  vector<pair<ll, ll>> jump;
  ll N, K, MOD = 998244353;
  cin >> N >> K;
  rep(i, K) {
    ll L, R;
    cin >> L >> R;
    jump.push_back({L, R});
  }
  pos[200001] = 1;
  sum[200001] = 1;
  for (ll i = 2; i <= N; i++) {
    rep(j, K) {
      ll L = jump[j].first;
      ll R = jump[j].second;
      pos[200000 + i] += sum[200000 + i - L];
      pos[200000 + i] -= sum[200000 + i - R - 1];
      pos[200000 + i] += MOD;
      pos[200000 + i] %= MOD;
    }
    sum[200000 + i] = sum[200000 + i - 1];
    sum[200000 + i] += pos[200000 + i];
    sum[200000 + i] %= MOD;
    //    cout << "i:" << i << " pos:" << pos[200000 + i]
    //      << " sum:" << sum[200000 + i] << endl;
  }
  cout << pos[200000 + N] << endl;
}


#include <bits/stdc++.h>
#define PI 3.141592653589793238462
using namespace std;
typedef long long ll;
typedef long double db;
set<ll> s;
ll d[200005], mod = 998244353;
int main() {
  ll n, k;
  cin >> n >> k;
  for (ll i = 1; i <= k; i++) {
    ll x, y;
    cin >> x >> y;
    for (int j = x; j <= y; j++) {
      s.insert(j);
    }
  }
  vector<ll> a;
  for (auto i : s) {
    a.push_back(i);
  }
  d[1] = 1;
  for (ll i = 2; i <= n; i++) {
    for (auto j : a) {
      if (i > j)
        d[i] += d[i - j], d[i] %= mod;
      else
        break;
    }
  }
  cout << d[n] % mod << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int mod = 998244353;
int n, k, lft[N], rgt[N];
int dp[N];

int add(int x, int y) {
  if (x + y >= mod) {
    return x + y - mod;
  }
  return x + y;
}

int sub(int x, int y) {
  if (x - y < 0) {
    return x - y + mod;
  }
  return x - y;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  cin >> n >> k;

  for (int i = 0; i < k; i++) {
    cin >> lft[i] >> rgt[i];
  }

  dp[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (i > 2) {
      dp[i] = add(dp[i], dp[i - 1]);
    }

    for (int j = 0; j < k; j++) {
      int l = i + lft[j];
      int r = i + rgt[j] + 1;

      dp[l] = add(dp[l], dp[i]);
      dp[r] = sub(dp[r], dp[i]);
    }
  }

  cout << dp[n] << '\\n';

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int mod = 998244353;
int n, k, lft[N], rgt[N];
int dp[N];

int add(int x, int y) {
  if (x + y >= mod) {
    return x + y - mod;
  }
  return x + y;
}

int sub(int x, int y) {
  if (x - y < 0) {
    return x - y + mod;
  }
  return x - y;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  cin >> n >> k;

  for (int i = 0; i < k; i++) {
    cin >> lft[i] >> rgt[i];
  }

  dp[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (i > 2) {
      dp[i] = add(dp[i], dp[i - 1]);
    }

    for (int j = 0; j < k; j++) {
      int l = i + lft[j];
      int r = i + rgt[j] + 1;

      if (l < N) {
        dp[l] = add(dp[l], dp[i]);
      }
      if (r < N) {
        dp[r] = sub(dp[r], dp[i]);
      }
    }
  }

  cout << dp[n] << '\\n';

  return 0;
}


#include <iostream>
#include <string>
using namespace std;
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <map>
#include <set>
#include <vector>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200010
#define LIMIT2 500010
#define LIMIT3 1000010
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
typedef long long ll;
typedef long double ld;
typedef const void cv;
typedef pair<ll, ll> P;
#define rep(i, n) for ((i) = 0; (i) < (n); (i)++)
#define per(i, n) for ((i) = (n)-1; (i) >= 0; (i)--)
template <class T, class C> T max(T a, C b) {
  return ((a) > (T)(b) ? (a) : (T)(b));
}
template <class T, class C> T min(T a, C b) {
  return ((a) < (T)(b) ? (a) : (T)(b));
}
#define zt(a, b) (max((a), (b)) - min((a), (b)))
#define setpre(n) fixed << setprecision(n)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}, dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int upint(cv *a, cv *b) {
  return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0;
}
int downint(cv *a, cv *b) {
  return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0;
}
int upchar(cv *left, cv *right) { return strcmp((char *)left, (char *)right); }
int downchar(cv *left, cv *right) {
  return strcmp((char *)right, (char *)left);
}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) {
      res *= a;
      if (mod >= 1)
        res %= mod;
    }
    a *= a;
    if (mod >= 1)
      a %= mod;
    n >>= 1;
  }
  return res;
}
void initialize() {}
const int MAX_N = LIMIT2;
int bit[MAX_N + 1] = {0}, n;
// 1-indexed BIT
ll sum(int i) {
  ll s = 0;
  while (i > 0) {
    s += bit[i];
    i -= i & (-i);
  }
  return s;
}
void add(int i, ll x) {
  while (i <= n) {
    bit[i] += x;
    i += i & (-i);
  }
}
ll rangesum(int l, int r) {
  if (l > r)
    return 0;
  return sum(r) - sum(l - 1);
}
int main(void) {
  initialize();
  ll m, i, j, k, result = 0;
  ll l[LIMIT1] = {0}, r[LIMIT1] = {0};
  ll dp[LIMIT1] = {0};
  string s;

  cin >> n >> k;
  rep(i, k) { cin >> l[i] >> r[i]; }

  dp[1] = 1;
  for (i = 1; i <= n; i++) {
    dp[i] += dp[i - 1];
    rep(j, k) {
      if (i + l[j] <= n) {
        dp[i + l[j]] += dp[i];
        dp[i + l[j]] %= MOD2;
        if (i + r[j] <= n)
          dp[i + r[j] + 1] -= dp[i];
        if (dp[i + r[j] + 1] < 0)
          dp[i + r[j] + 1] += MOD2;
        // cout << i << ":" << i+l[j] << ":" << i+r[j] << endl;
      }
    }
  }

  result = dp[n] - dp[n - 1];

  cout << result << endl;
  return 0;
}

#include <iostream>
#include <string>
using namespace std;
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <map>
#include <set>
#include <vector>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200010
#define LIMIT2 500010
#define LIMIT3 1000010
#define INF ((1 << 30) - 1)
#define LLINF (1LL << 60)
#define EPS (1e-10)
typedef long long ll;
typedef long double ld;
typedef const void cv;
typedef pair<ll, ll> P;
#define rep(i, n) for ((i) = 0; (i) < (n); (i)++)
#define per(i, n) for ((i) = (n)-1; (i) >= 0; (i)--)
template <class T, class C> T max(T a, C b) {
  return ((a) > (T)(b) ? (a) : (T)(b));
}
template <class T, class C> T min(T a, C b) {
  return ((a) < (T)(b) ? (a) : (T)(b));
}
#define zt(a, b) (max((a), (b)) - min((a), (b)))
#define setpre(n) fixed << setprecision(n)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}, dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int upint(cv *a, cv *b) {
  return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0;
}
int downint(cv *a, cv *b) {
  return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0;
}
int upchar(cv *left, cv *right) { return strcmp((char *)left, (char *)right); }
int downchar(cv *left, cv *right) {
  return strcmp((char *)right, (char *)left);
}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) {
      res *= a;
      if (mod >= 1)
        res %= mod;
    }
    a *= a;
    if (mod >= 1)
      a %= mod;
    n >>= 1;
  }
  return res;
}
void initialize() {}
const int MAX_N = LIMIT2;
int bit[MAX_N + 1] = {0}, n;
// 1-indexed BIT
ll sum(int i) {
  ll s = 0;
  while (i > 0) {
    s += bit[i];
    i -= i & (-i);
  }
  return s;
}
void add(int i, ll x) {
  while (i <= n) {
    bit[i] += x;
    i += i & (-i);
  }
}
ll rangesum(int l, int r) {
  if (l > r)
    return 0;
  return sum(r) - sum(l - 1);
}
int main(void) {
  initialize();
  ll m, i, j, k, result = 0;
  ll l[LIMIT1] = {0}, r[LIMIT1] = {0};
  ll dp[LIMIT1] = {0};
  string s;

  cin >> n >> k;
  rep(i, k) { cin >> l[i] >> r[i]; }

  dp[1] = 1;
  for (i = 1; i <= n; i++) {
    dp[i] += dp[i - 1];
    rep(j, k) {
      if (i + l[j] <= n) {
        dp[i + l[j]] += dp[i];
        dp[i + l[j]] %= MOD2;
        if (i + r[j] <= n)
          dp[i + r[j] + 1] -= dp[i];
        if (i + r[j] + 1 <= n && dp[i + r[j] + 1] < 0)
          dp[i + r[j] + 1] += MOD2;
        // cout << i << ":" << i+l[j] << ":" << i+r[j] << endl;
      }
    }
  }

  result = dp[n] - dp[n - 1];

  cout << result << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define M 998244353
long long tree[400005], dp[200001], lazy[400005];
void build(int node, int start, int end) {
  if (start == end) {
    // Leaf node will have a single element
    tree[node] = dp[start];
  } else {
    int mid = (start + end) / 2;
    // Recurse on the left child
    build(2 * node, start, mid);
    // Recurse on the right child
    build(2 * node + 1, mid + 1, end);
    // Internal node will have the sum of both of its children
    tree[node] = (tree[2 * node] + tree[2 * node + 1]) % M;
  }
}
void updateRange(int node, int start, int end, int l, int r, int val) {
  if (lazy[node] != 0) {
    // This node needs to be updated
    tree[node] += (end - start + 1) * lazy[node]; // Update it
    if (start != end) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2] %= M; // Mark child as lazy
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 1] %= M; // Mark child as lazy
    }
    lazy[node] = 0; // Reset it
  }
  if (start > end or start > r or
      end < l) // Current segment is not within range [l, r]
    return;
  if (start >= l and end <= r) {
    // Segment is fully within range
    tree[node] += ((end - start + 1) * val) % M;
    tree[node] %= M;
    if (start != end) {
      // Not leaf node
      lazy[node * 2] += val;
      lazy[node * 2] %= M;
      lazy[node * 2 + 1] += val;
      lazy[node * 2 + 1] %= M;
    }
    return;
  }
  int mid = (start + end) / 2;
  updateRange(node * 2, start, mid, l, r, val);       // Updating left child
  updateRange(node * 2 + 1, mid + 1, end, l, r, val); // Updating right child
  tree[node] =
      (tree[node * 2] + tree[node * 2 + 1]) % M; // Updating root with max value
}

int queryRange(int node, int start, int end, int l, int r) {
  if (start > end or start > r or end < l)
    return 0; // Out of range
  if (lazy[node] != 0) {
    // This node needs to be updated
    tree[node] += ((end - start + 1) * lazy[node]) % M;
    tree[node] %= M; // Update it
    if (start != end) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2] %= M; // Mark child as lazy
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 1] %= M; // Mark child as lazy
    }
    lazy[node] = 0; // Reset it
  }
  if (start >= l and end <= r) // Current segment is totally within range [l, r]
    return tree[node];
  int mid = (start + end) / 2;
  int p1 = queryRange(node * 2, start, mid, l, r);       // Query left child
  int p2 = queryRange(node * 2 + 1, mid + 1, end, l, r); // Query right child
  return (p1 + p2) % M;
}
int main() {
// your code goes here
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("res.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  int l[k], r[k], li = 0;
  for (int i = 0; i < k; i++)
    cin >> l[i] >> r[i];
  for (int i = 0; i <= n; i++)
    dp[i] = 0;
  dp[1] = 1;
  build(1, 1, n);
  // cout<<tree[5]<<endl;
  for (int i = 1; i <= n; i++) {
    dp[i] = queryRange(1, 1, n, i, i) % M;
    // cout<<dp[i]<<endl;
    for (int j = 0; j < k; j++) {
      if (i + l[j] <= n)
        updateRange(1, 1, n, i + l[j], min(i + r[j], n), dp[i] % M);
    }
  }
  // for(int i=1;i<n;i++)
  //	dp[i]+=dp[i-1];
  cout << dp[n] % M;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define M 998244353
long long tree[5000050], dp[3000005], lazy[5000050];
void build(int node, int start, int end) {
  if (start == end) {
    // Leaf node will have a single element
    tree[node] = dp[start];
  } else {
    int mid = (start + end) / 2;
    // Recurse on the left child
    build(2 * node, start, mid);
    // Recurse on the right child
    build(2 * node + 1, mid + 1, end);
    // Internal node will have the sum of both of its children
    tree[node] = (tree[2 * node] + tree[2 * node + 1]) % M;
  }
}
void updateRange(int node, int start, int end, int l, int r, int val) {
  if (lazy[node] != 0) {
    // This node needs to be updated
    tree[node] += (end - start + 1) * lazy[node]; // Update it
    if (start != end) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2] %= M; // Mark child as lazy
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 1] %= M; // Mark child as lazy
    }
    lazy[node] = 0; // Reset it
  }
  if (start > end or start > r or
      end < l) // Current segment is not within range [l, r]
    return;
  if (start >= l and end <= r) {
    // Segment is fully within range
    tree[node] += ((end - start + 1) * val) % M;
    tree[node] %= M;
    if (start != end) {
      // Not leaf node
      lazy[node * 2] += val;
      lazy[node * 2] %= M;
      lazy[node * 2 + 1] += val;
      lazy[node * 2 + 1] %= M;
    }
    return;
  }
  int mid = (start + end) / 2;
  updateRange(node * 2, start, mid, l, r, val);       // Updating left child
  updateRange(node * 2 + 1, mid + 1, end, l, r, val); // Updating right child
  tree[node] =
      (tree[node * 2] + tree[node * 2 + 1]) % M; // Updating root with max value
}

int queryRange(int node, int start, int end, int l, int r) {
  if (start > end or start > r or end < l)
    return 0; // Out of range
  if (lazy[node] != 0) {
    // This node needs to be updated
    tree[node] += ((end - start + 1) * lazy[node]) % M;
    tree[node] %= M; // Update it
    if (start != end) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2] %= M; // Mark child as lazy
      lazy[node * 2 + 1] += lazy[node];
      lazy[node * 2 + 1] %= M; // Mark child as lazy
    }
    lazy[node] = 0; // Reset it
  }
  if (start >= l and end <= r) // Current segment is totally within range [l, r]
    return tree[node];
  int mid = (start + end) / 2;
  int p1 = queryRange(node * 2, start, mid, l, r);       // Query left child
  int p2 = queryRange(node * 2 + 1, mid + 1, end, l, r); // Query right child
  return (p1 + p2) % M;
}
int main() {
// your code goes here
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("res.txt", "w", stdout);
#endif
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  int l[k], r[k], li = 0;
  for (int i = 0; i < k; i++)
    cin >> l[i] >> r[i];
  for (int i = 0; i <= n; i++)
    dp[i] = 0;
  dp[1] = 1;
  build(1, 1, n);
  // cout<<tree[5]<<endl;
  for (int i = 1; i <= n; i++) {
    dp[i] = queryRange(1, 1, n, i, i) % M;
    // cout<<dp[i]<<endl;
    for (int j = 0; j < k; j++) {
      if (i + l[j] <= n)
        updateRange(1, 1, n, i + l[j], min(i + r[j], n), dp[i] % M);
    }
  }
  // for(int i=1;i<n;i++)
  //	dp[i]+=dp[i-1];
  cout << dp[n] % M;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
;
#define mod 998244353LL

int main(void) {
  int N, K;
  cin >> N >> K;
  int a[K], b[K];
  vector<bool> S(N + 1, 0);
  for (int i = 0; i < K; i++) {
    cin >> a[i] >> b[i];
    for (int j = a[i]; j < b[i] + 1; j++)
      S[j] = 1;
  }
  vector<long long> dp(N + 1, 0);
  dp[1] = 1;

  for (int i = 1; i <= N; i++) {
    for (int j = 1; j < i; j++) {
      if (S[j]) {
        dp[i] = (dp[i] + dp[i - j]) % mod;
      }
    }
  }

  cout << dp[N] << endl;
}

#include <bits/stdc++.h>
using namespace std;
;
#define mod 998244353ll

int main(void) {
  int N, K;
  cin >> N >> K;
  int l[K], r[K];
  for (int i = 0; i < K; i++)
    cin >> l[i] >> r[i];

  vector<long long> dp(N + 1, 0);
  dp[0] = 0;
  dp[1] = 1;

  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < K; j++) {
      if (i - l[j] <= 0)
        continue;
      dp[i] = (dp[i] + dp[i - l[j]] - dp[max(0, i - r[j] - 1)]) % mod;
    }
    dp[i] = (dp[i] + dp[i - 1]) % mod;
  }

  long long ans = (dp[N] - dp[N - 1] + mod) % mod;

  cout << ans << endl;
}


#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
typedef long long ll;
typedef long double ld;
typedef unsigned int ull;
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define int ll
#define pll pair<ll, ll>
#define pdd pair<ld, ld>
#define pb push_back
#define reset(x, v) memset(x, v, sizeof(x))
#define mod 998244353
using namespace std;

ll power(ll x, ll y) {
  if (x == 1 || y == 0)
    return 1;
  ll res = 1;
  x = x % mod;
  if (x == 0)
    return 0;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
int dp[200005];
int solve(int st, int n, pii p[], int k) {
  if (st == n)
    return 1;
  if (dp[st] != -1)
    return dp[st];
  int so = 0;
  rep(i, 0, k) {
    for (int j = p[i].first; j <= p[i].second; j++) {
      if (j + st > n)
        break;
      so = (so + solve(st + j, n, p, k)) % mod;
    }
  }
  return dp[st] = so;
}

signed main() {
  FASTIO
  int n, k;
  cin >> n >> k;
  pii p[k];
  rep(i, 0, n + 1) dp[i] = -1;
  rep(i, 0, k) { cin >> p[i].first >> p[i].second; }
  cout << solve(1, n, p, k);
  return 0;
}

#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
typedef long long ll;
typedef long double ld;
typedef unsigned int ull;
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define int ll
#define pll pair<ll, ll>
#define pdd pair<ld, ld>
#define pb push_back
#define reset(x, v) memset(x, v, sizeof(x))
#define mod 998244353
using namespace std;

ll power(ll x, ll y) {
  if (x == 1 || y == 0)
    return 1;
  ll res = 1;
  x = x % mod;
  if (x == 0)
    return 0;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
int dp[200005];
int solve(int st, int n, pii p[], int k) {
  if (st == n)
    return 1;
  if (dp[st] != -1)
    return dp[st];
  int so = 0;
  rep(i, 0, k) {}
  return dp[st] = so;
}

signed main() {
  FASTIO
  int n, k;
  cin >> n >> k;
  pii p[k];
  rep(i, 0, k) { cin >> p[i].first >> p[i].second; }
  sort(p, p + k);
  int suff[n + 2];
  suff[n + 1] = 0;
  dp[n] = 1;
  suff[n] = 1;
  for (int i = n - 1; i > 0; i--) {
    dp[i] = 0;
    int L = n + 1, R = 0;
    rep(j, 0, k) {
      int l = p[j].first + i, r = min(p[j].second, n - i) + i;
      if (l > n || l > r)
        break;
      dp[i] = (dp[i] + (suff[l] - suff[r + 1] + mod) % mod) % mod;
      if (l == n)
        break;
    }
    // cout << i << " " << dp[i] << endl;
    suff[i] = (suff[i + 1] + dp[i]) % mod;
  }
  cout << dp[1];
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
static const ll mod = 998244353;
ll N, K;
ll dp[100005];
ll sum[100005];
int main() {
  cin >> N >> K;
  vector<P> A(K);
  for (ll i = 0; i < K; i++) {
    ll l, r;
    cin >> l >> r;
    P p(l, r);
    A[i] = p;
  }
  dp[0] = 1;
  sum[0] = 1;
  for (ll i = 1; i < N; i++) {
    for (ll j = 0; j < K; j++) {
      ll l = A[j].first;
      ll r = A[j].second;
      if (i - l < 0) {
      } else if (0 <= i - l && 0 <= i - r - 1) {
        dp[i] = (dp[i] + sum[i - l] - sum[i - r - 1] + 2 * mod) % mod;
      } else
        dp[i] = (dp[i] + sum[i - l]) % mod;
    }
    sum[i] = (sum[i - 1] + dp[i]) % mod;
  }
  cout << dp[N - 1] << endl;

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
static const ll mod = 998244353;
ll N, K;
ll dp[200005];
ll sum[200005];
int main() {
  cin >> N >> K;
  vector<P> A(K);
  for (ll i = 0; i < K; i++) {
    ll l, r;
    cin >> l >> r;
    P p(l, r);
    A[i] = p;
  }
  dp[0] = 1;
  sum[0] = 1;
  for (ll i = 1; i < N; i++) {
    for (ll j = 0; j < K; j++) {
      ll l = A[j].first;
      ll r = A[j].second;
      if (i - l < 0) {
      } else if (0 <= i - l && 0 <= i - r - 1) {
        dp[i] = (dp[i] + sum[i - l] - sum[i - r - 1] + 2 * mod) % mod;
      } else
        dp[i] = (dp[i] + sum[i - l]) % mod;
    }
    sum[i] = (sum[i - 1] + dp[i]) % mod;
  }
  cout << dp[N - 1] << endl;

  return 0;
}