#include #include using namespace std; using str = string; using ll = long long; using ld = long double; using u64 = unsigned long long; template using pr = pair; template using vt = vector; template using vvt = vector>; #define ar array #define pb push_back #define fi first #define se second #define all(c) (c).begin(), (c).end() #define len(x) (int)(x).size() #define elif else if #define def function #define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s)) #define F_OR1(e) F_OR(i, 0, e, 1) #define F_OR2(i, e) F_OR(i, 0, e, 1) #define F_OR3(i, b, e) F_OR(i, b, e, 1) #define F_OR4(i, b, e, s) F_OR(i, b, e, s) #define GET5(a, b, c, d, e, ...) e #define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1) #define rep(...) F_ORC(__VA_ARGS__)(__VA_ARGS__) #define each(x, a) for (auto& x: a) #define r_each(x,a) for(auto& x:a | views::reverse) template constexpr T inf = 0; template<> constexpr int inf = 1'000'000'005; template<> constexpr long long inf = (long long) (inf) * inf * 2; template<> constexpr unsigned int inf = inf; template<> constexpr unsigned long long inf = inf; template<> constexpr __int128 inf<__int128> = __int128(inf) * inf; template<> constexpr double inf = inf; template<> constexpr long double inf = inf; template inline bool ctmax(T &a, const S &b) { return (a < b ? a = b, 1 : 0); } template inline bool ctmin(T &a, const S &b) { return (a > b ? a = b, 1 : 0); } template ostream &operator<<(ostream &os, const pair &p) {os << p.first << " " << p.second;return os;} template istream &operator>>(istream &is, pair &p) {is >> p.first >> p.second;return is;} template ostream &operator<<(ostream &os, const vector &v) {int s = (int) v.size();for (int i = 0; i < s; i++) os << (i ? " " : "") << v[i];return os;} template istream &operator>>(istream &is, vector &v) {for (auto &x: v) is >> x;return is;} void read() {} template void read(T &t, U &...u) {cin >> t;read(u...);} void print() { cout << "\n"; } template void print(const T &t, const U &...u) {cout << t;if (sizeof...(u)) cout << sep;print(u...);} void write() { cout << " "; } template void write(const T &t, const U &...u) {cout << t;if (sizeof...(u)) cout << sep;write(u...);} #define Int(...) \ int __VA_ARGS__; \ read(__VA_ARGS__) #define Ll(...) \ long long __VA_ARGS__; \ read(__VA_ARGS__) #define Str(...) \ string __VA_ARGS__; \ read(__VA_ARGS__) #define Vt(type, name, size) \ vector name(size); \ read(name) #define Die(...) \ do { \ print(__VA_ARGS__); \ return 0; \ } while (0) __attribute__((target("popcnt"))) inline int popcnt(const u64 &a) { return _mm_popcnt_u64(a); } inline int lsb(const u64 &a) { return a ? __builtin_ctzll(a) : 64; } inline int ctz(const u64 &a) { return a ? __builtin_ctzll(a) : 64; } inline int msb(const u64 &a) { return a ? 63 - __builtin_clzll(a) : -1; } template inline int gbit(const T &a, int i) { return (a >> i) & 1; } template inline void sbit(T &a, int i, bool b) { if (gbit(a, i) != b) a ^= T(1) << i; } constexpr long long Pw(int n) { return 1LL << n; } constexpr long long Msk(int n) { return (1LL << n) - 1; } template vector argsort(const vector &A) { vector ids((int) A.size()); iota(ids.begin(), ids.end(), 0); sort(ids.begin(), ids.end(), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); }); return ids; } #define MIN(v) *min_element(all(v)) #define MAX(v) *max_element(all(v)) #define LB(c, x) distance((c).begin(), lower_bound(all(c), (x))) #define UB(c, x) distance((c).begin(), upper_bound(all(c), (x))) #define UNIQUE(x) \ sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit() namespace dbg{ // DEBUG BEGIN #ifndef ONLINE_JUDGE template ostream &operator<<(ostream &out, const pair &p){ return out << "{" << p.first << ", " << p.second << "}"; } template struct _tuple_printer{ static ostream &_print(ostream &out, const Tuple &t){ return _tuple_printer::_print(out, t) << ", " << get(t); } }; template struct _tuple_printer{ static ostream &_print(ostream &out, const Tuple& t){ return out << get<0>(t); } }; template ostream &_print_tuple(ostream &out, const tuple &t){ return _tuple_printer::_print(out << "{", t) << "}"; } template ostream &operator<<(ostream &out, const tuple &t){ return _print_tuple(out, t); } template ostream &operator<<(class enable_if::value, ostream>::type &out, const T &arr){ if(arr.empty()) return out << "{}"; out << "{"; for(auto it = arr.begin(); it != arr.end(); ++ it){ out << *it; next(it) != arr.end() ? out << ", " : out << "}"; } return out; } ostream &operator<<(ostream &out, const _Bit_reference &bit){ return out << bool(bit); } template ostream &operator<<(ostream &out, priority_queue pq){ vector a; while(!pq.empty()) a.push_back(pq.top()), pq.pop(); return out << a; } template void debug_out(Head H){ cerr << H << endl; } template void debug_out(Head H, Tail... T){ cerr << H << ", ", debug_out(T...); } void debug2_out(){ } template void debug2_out(Head H, Tail... T){ cerr << "\n"; for(auto x: H) cerr << x << ",\n"; debug2_out(T...); } template void debugbin_out(Width w, Head H){ for(auto rep = w; rep; -- rep, H >>= 1) cerr << (H & 1); cerr << endl; } template void debugbin_out(Width w, Head H, Tail... T){ for(auto rep = w; rep; -- rep, H >>= 1) cerr << (H & 1); cerr << ", "; debugbin_out(w, T...); } enum CODE{ CCRED = 31, CCGREEN = 32, CCYELLOW = 33, CCBLUE = 34, CCDEFAULT = 39 }; #define debug_endl() cerr << endl #define debug(...) cerr << "\033[" << (int)CODE(CCRED) << "m[" << #__VA_ARGS__ << "]: \033[" << (int)CODE(CCBLUE) << "m", debug_out(__VA_ARGS__), cerr << "\33[" << (int)CODE(CCDEFAULT) << "m" #define debug2(...) cerr << "\033[" << (int)CODE(CCRED) << "m[" << #__VA_ARGS__ << "] \033[" << (int)CODE(CCBLUE) << "m", debug2_out(__VA_ARGS__), cerr << "\33[" << (int)CODE(CCDEFAULT) << "m" #define debugbin(...) cerr << "\033[" << (int)CODE(CCRED) << "m[" << #__VA_ARGS__ << "] \033[" << (int)CODE(CCBLUE) << "m", debugbin_out(__VA_ARGS__), cerr << "\33[" << (int)CODE(CCDEFAULT) << "m" #else #define debug_endl() 42 #define debug(...) 42 #define debug2(...) 42 #define debugbin(...) 42 #endif // DEBUG END } using namespace dbg; signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); auto __solve_tc = [&](auto __tc_num) -> int { Int(n); ll res=0; // calc 8c0 to 8c5 rep(6){ ll temp=1; vt divides(8,1); rep(j,1,8){ temp*=((6-i)*n-i+j); rep(j,1,8) if(temp % j==0 && divides[j]) temp/=j,divides[j]=0; } ll te=1; rep(j,i) te*=(8-j); rep(j,i) te/=(j+1); debug(temp,te); if(i&1) res-=(temp*te); else res+=(temp*te); } print(res); return 0; }; int __tc_cnt = 1; // cin >> __tc_cnt; for (auto __tc_num = 0; __tc_num < __tc_cnt; ++__tc_num) { __solve_tc(__tc_num); } }