#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <cstring>
#include <map>
#include <string>
#define inf 0x3f3f3f3f
#define  _for(i,a,b) for( int i=(a); i<(b); ++i)
#define  __for(i,a,b) for( int i=(b); i>=(a); --i)
using namespace std;
typedef pair<int,int>pii;
typedef unsigned long long ll;
const int mod =1e9+7;
const int N=1e5+7;

int main( )
{
   int a,b,c;
    cin>>a>>b>>c;
   cout<<7-a+7-b+7-c;


    return 0;
}


//================code===================//

#define TLE

#ifdef TLE
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#endif

#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <ctime>

#define ci(t) cin>>t
#define co(t) cout<<t
#define LL long long
#define ld long double
#define fa(i,a,b) for(LL i=(a);i<(LL)(b);++i)
#define fd(i,a,b) for(LL i=(a);i>(LL)(b);--i)
#define setp pair<pair<int,int>,int>
#define setl pair<LL,LL>

#define M_PI 3.14159265358979323846
#define micro 0.000001

using namespace std;

#ifdef OHSOLUTION
#define ce(t) cerr<<t
#define AT cerr << "\n=================ANS=================\n"
#define AE cerr << "\n=====================================\n"
LL gcd(LL a, LL b) { return a % b ? gcd(b, a % b) : b; }
LL lcm(LL a, LL b) { return (a * b) / gcd(a, b); }
#else
#define AT
#define AE
#define ce(t)
#define __popcnt __builtin_popcount
#define gcd __gcd
#define lcm __lcm
#endif


pair <int, int> vu[9] = { {0,1},{1,0},{0,-1} ,{-1,0},{0,1},{1,0}, {-1,1} , {1,-1},{-1,-1} }; //RDLU EWSN

template<typename T, typename U> void ckmax(T& a, U b) { a = a < b ? b : a; }
template<typename T, typename U> void ckmin(T& a, U b) { a = a > b ? b : a; }
struct gcmp { bool operator()(LL a, LL b) { return a < b; } bool operator()(setl a, setl b) { return a.second < b.second; } };
struct lcmp { bool operator()(LL a, LL b) { return a > b; } bool operator()(setl a, setl b) { return a.second > b.second; } };

const int max_v = 2e5 + 7;
const int INF = 1e9 + 7;
const LL LNF = (LL)5e18 + 7ll;
const LL mod = 1e9+7;



int main()
{
#ifdef OHSOLUTION
	freopen("input.txt", "r", stdin);
#endif	
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);		
	LL n; ci(n);
	LL x;
	fa(i, 1, n+1)
	{
		if (i * i * i > n) break;
		x = i;
	}

	LL ans = x * x * x;

	fa(i, x + 1, n+1)
	{
		bool ck = false;
		fa(j, 1, i+1)
		{
			if (i * j > n) break;

			fa(t, 1,j+1)
			{
				if (i * j * t <= n)
				{
					//ce(i << " " << j << " " << t << endl);

					int c = (i == j) + (i == t) + (j == t);

					ck = true;

					if (c == 3) ++ans;
					else if (c == 1) ans += 3ll;
					else ans += 6ll;
				}
				else break;
			}
		}

		if (!ck) break;
	}

	co(ans);

	return 0;
}