#include <cstdio>
//33319741730082870
#define LL __int64
LL zuHe(LL n,int m)
{
if(n<m) return 0;
if(n==m) return 1;
LL ans=1;
int j=2;
for(int i=n-m+1;i<=n;++i)
{
ans*=i;
while(j<=m&&ans%j==0)
{
ans/=j;
++j;
}
}
while(j<=m)
{
ans/=j;
++j;
}
return ans;
}
int main()
{
LL n;
while(~scanf("%I64d",&n))
{
LL ans=0;
for(int i=5;i<=7;++i)
{
ans+=zuHe(n,i);
}
printf("%I64d\n",ans);
}
return 0;
}