447244
 958507
 816923
 836603
 862795
 756604
 1000000
 4
 668827
 245
 520731
 642635
 8
 244
 148
 213
 984699
 20
 810411
 796
 924
 341
 41
 33
 604
 117
 978187
 5
 546924
 29
 3
 829
 509
 733
 412
 372636
 149
 2
 296604
 6
 605
 53
 12
 18
 30
 700
 508
 763116
 688507
 732
 21
 636
 695019
 828
 714700
 925
 1
 540412
 116

89460162932862372
 880611813728059710
 545182335484592526
 585540171302562606
 642275489615199390
 433115377058855412
 999996000003000000
 12
 299184742915995150
 14526540
 141201007712496270
 265393998349453470
 280
 14289372
 3154620
 9527916
 954792870629291694
 6460
 532248411551110590
 501826260
 783776526
 39303660
 63960
 32736
 218891412
 1560780
 935975171582120670
 60
 163597318076822526
 21924
 6
 567662724
 131096004
 392222436
 69256788
 51742503205363470
 3241644
 2
 26092892528622606
 60
 220348260
 140556
 990
 4080
 21924
 341042100
 130065780
 444394078546562430
 326379736779169710
 389016270
 7980
 254839470
 335728459024850814
 563559150
 365063922340784100
 788888100
 1
 157823524476316788
 1507420

#include <bits/stdc++.h>
#include<string>
#define sz(v)   ((int)(v).size())
#define  eps      0.00000000000001
#define  all(v)    ((v).begin()),((v).end())
#define  allr(v)    ((v).rbegin()),((v).rend())
#define   pb         push_back
#define   mp         make_pair
#define   inf        0x7fffffff
#define    PI        3.1415926536
#define    clr(v,d)      memset( v, d ,sizeof(v))
#define    vi       vector<int>
#define    vd       vector<double>
#define    vvi      vector< vector<int> >
#define    vvpi     vector< vector< pair<int,int> > >
#define    vvd      vector< vector<double> >
#define    vs       vector<string>
#define    vvs      vector< vector<string> >
#define     vc        vector<char>
#define     vpi        vector< pair<int ,int> >
#define      pi        pair<int ,int>
#define      pll       pair<long long ,long long>
#define     vpd        vector< pair<double ,double> >
#define     vpll        vector< pair<long long ,long long> >
#define    vll       vector<long long>
#define    dqi        deque< int >
#define     row          vector< double >
#define     matrix            vector< row >
#define    lp(i,n)    for(i=0;i<n;i++)
#define     si         set<int>
#define    oo         100000000000
#define   MOD         1000000007
#define    X            real
#define    Y            imag
#define   angle(n)      atan2((n.imag()),(n.real()))
#define   vec(a,b)       ((b)-(a))
#define   length(a)      hypot( (a.imag()),(a.real()) )
#define   normalize(a)      (a)/(length(a))
#define    dp(a,b)          (((conj(a))*(b)).real())
#define    cp(a,b)          (((conj(a))*(b)).imag())
#define    lengthsqrt(a)       dp(a,a)
#define    rotate0( a,ang)    ((a)*exp( point(0,ang) ))
#define    rotateA(about,p,ang)   (rotate0(vec(about,p),ang)+about)
#define    lcm(a,b)                ((a*b)/(__gcd(a,b)))
#define    reflection0(m,v)         (conj((v)/(m))*(m))
#define     reflectionA(m,v,p0)     (conj( (vec(p0,v))/(vec(p0,m)) ) * (vec(p0,m)) ) + p0
#define     same(p1,p2)               ( dp(  vec(p1,p2),vec(p1,p2)) < eps )
#define     point                    complex<double>
#define    scani(n)                  scanf("%d",&n)
#define    scanll(n)                  scanf("%I64d",&n)
#define    printi(n)                 printf("%d",n)
#define    printll(n)                 printf("%I64d",n)
#define    scand(n)                  scanf("%lf",&n)
#define    printd(n)                 printf("%lf",n)
#define    scans(n)                  scanf("%s",&n)
#define    prints(n)                 printf("%s",n)
typedef  long long     ll ;
typedef  unsigned long long ull;
using namespace std;
int dcmp(double a,double b){   return fabs(a-b)<=eps ? 0: (a>b)? 1:-1 ;}

int main()
{

   
   int x,y,z,n;
   
   cin>>n;
   
   if(n>=3)
   {
       x=n;
       y=n-1;
       z=n-2;
   }
   else
   {
      x=n;
      y=n;
      z=n;
   }

  cout<<  lcm(lcm(x,y),z)<<endl;








}



