#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define sorts(s) sort(s.begin(), s.end())
#define sortu(s) sort(s.begin(), s.end(), greater<>())
typedef long long int ll;
using Graph = vector<vector<int>>;

int main(void) {
    //int i = 0, j = 0, k = 0;
    ll N;
    cin >> N;
    ll ans = 0;
    for (ll i = 1; i <= N; ++i) {
        if (N*2/i <= i) break;
        if (i % 2 == 1) {
            if (N % i == 0) ans++;
        } else {
            if (N % i != 0 && (N*2) % i == 0) ans++;
        }
    }
    ans *= 2;
    cout << ans << endl;
    //cout << fixed << setprecision(20) << ans << endl;
    return 0;
}
#include <algorithm>
#include <iostream>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

struct Event {
  int time, index;
  bool start;
  inline bool operator<(const Event& other) const {
    return make_tuple(time, start, index) \
      < make_tuple(other.time, other.start, other.index);
  }
};

template <typename T = int>
std::vector<T> ReadArray(int size = 0, std::istream& in_stream = std::cin);

template <typename T>
void PrintArray(const std::vector<T>& array, std::ostream& out_stream = std::cout,
                bool size = false, char element_separator = ' ', char end = '\n');

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

  int64_t n;
  cin >> n;
  n <<= 1;

  int64_t answer = 0;

  for (int64_t s = 1; s * s <= n; ++s) {
    if (n % s == 0) {
      int64_t d = n / s - 1;
      if ((d & 1) == (s & 1)) {
        ++answer;
      }
    }
  }

  for (int64_t t = 1; t * t < n; ++t) {
    if (n % t == 0) {
      int64_t s = n / t;
      int64_t d = n / s - 1;
      if ((d & 1) == (s & 1)) {
        ++answer;
      }
    }
  }

  cout << answer << "\n";

  return 0;
}

template <typename T>
std::vector<T> ReadArray(int size, std::istream& in_stream) {
  if (!size) {
    in_stream >> size;
  }
  std::vector<T> array(size);
  for (auto& element : array) {
    in_stream >> element;
  }
  return array;
}

template <typename T>
void PrintArray(const std::vector<T>& array, std::ostream& out_stream,
                bool size, char element_separator, char end) {
  if (size) {
    out_stream << array.size() << end;
  }
  for (const auto& element : array) {
    out_stream << element << element_separator;
  }
  out_stream << end;
}
