codeparrot/codecomplex huggingface dataset:
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    /////////////////////////////////////////////////////////////

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
    int n=in.nextInt();
        if(n==1||n==2){
            out.println(n);
            return;
        }
        if(n==4){
            out.println(12);
            return;
        }
     long nn=n;
        if(n%2==1){
        long ans=nn*(nn-1)*(nn-2);
            out.println(ans);
        }
        else if(n%3==0){
            nn--;
            long ans=nn*(nn-1)*(nn-2);
            out.println(ans);

        }
        else {
            long ans=nn*(nn-1)*(nn-3);
            out.println(ans);
            
        }

    }
    }

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }


}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.*;
import java.util.*;

public class Lcm
{
public static void main(String args[])throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

long n=Long.parseLong(br.readLine());
if(n<=2)
System.out.println(n);
else
{

 if(n%6==0)
{
 System.out.println(((n-1)*(n-2)*(n-3)));
}
 else if(n%2==0)
{
  System.out.println((n*(n-1)*(n-3)));
}
else
{
  System.out.println((n*(n-1)*(n-2)));
}
}

}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.*;

public class LCM235A
{
    public static void main(String[] args) 
    {
        // Set up scanner
        Scanner sc = new Scanner(System.in); 
        // System.out.println("Enter n");
        long n = sc.nextLong();
        
        if (n==1)
        {
            System.out.println(1);
            return;
        }
        if (n==2)
        {
            System.out.println(2);
            return;
        }
        if (n==3)
        {
            System.out.println(6);
            return;
        }
        if (n==4)
        {
            System.out.println(12);
            return;
        }
        
        if (n%2 ==1)   // Odd number easy
        {
            System.out.println(n*(n-1)*(n-2));
            return;
        }
        
        // Even number is a bit harder
        if (n%3 == 0)
        {
            System.out.println((n-1)*(n-2)*(n-3));
        }
        else
        {
            System.out.println(n*(n-1)*(n-3));
        }
    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author walker
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        long n = in.readInt();
        if(n < 3){
            out.print(n);
        }
        else if(n % 2 != 0) {
            out.print(n * (n-1) * (n-2));
        }
        else if(n % 3 == 0) {
            out.print((n-1) * (n-2) * (n-3));
        }
        else {
            out.print(n * (n-1) * (n-3));
        }
    }
}

class InputReader {

	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream) {
		this.stream = stream;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int readInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	public static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.BufferedInputStream;
import java.util.Scanner;

/**
 * Created by jizhe on 2016/1/29.
 */
public class LCMChallenge {
    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedInputStream(System.in));

        long N = in.nextLong();
        if( N == 1 || N == 2 )
        {
            System.out.printf("%d\n", N);
            return;
        }

        if( (N&1) == 1 )
        {
            long lcm = N*(N-1)*(N-2);
            System.out.printf("%d\n", lcm);
        }
        else
        {
            long lcm;
            if( N%3 == 0 )
            {
                lcm = (N-1)*(N-2)*(N-3);
            }
            else
            {
                lcm = N*(N-1)*(N-3);
            }

            System.out.printf("%d\n", lcm);
        }
    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.Arrays;
import java.util.Scanner;
public class Main{
  public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
       Long N = sc.nextLong();
       Long ans;
       sc.close();
       if(N <= 2)
           System.out.println(N);
       else{
           if(N % 6 == 0){
                ans = (N - 1) * (N - 2) * (N - 3);}
            else if(N % 2 == 0){
                ans = N * (N - 1) * (N - 3);
            }
            else{
                ans = N * (N - 1) * (N - 2);
            }
           System.out.println(ans);
       }
    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.Scanner;
public class Solution {
    public static void main(String [] args){
        Scanner stdin = new Scanner(System.in);
        long n = stdin.nextLong();
        if(n<3)	System.out.println(n);
        else {
            if(n%2==0){
                long a=0,b=0;
                if(n%3!=0)	a = (n*(n-1)*(n-3));    
                n--;
                b = (n*(n-1)*(n-2));
                System.out.println(Math.max(a, b));
            }
            else	System.out.println(n*(n-1)*(n-2));
        }
    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n == 1 || n == 2) {
            System.out.println(n);
        } else if (n % 2 == 0) {
            if (n % 3 == 0)
                System.out.println((n - 1) * (n - 2) * (n - 3));
            else
                System.out.println(n * (n - 1) * (n - 3));
        } else {
            System.out.println(n * (n - 1) * (n - 2));
        }
    }

}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.PrintStream;
import java.util.Scanner;

/**
 * @author Roman Elizarov
 */
public class Round_146_A {
	public static void main(String[] args) {
		new Round_146_A().go();
	}

	void go() {
		// read input
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();

		// solve
		long result = solve(n);

		// write result
		PrintStream out = System.out;
		out.println(result);
	}

	static long solve(int n) {
        if (n == 1)
            return 1;
        if (n == 2)
            return 2;
        if (n % 2 == 0) {
            if (n % 3 == 0)
                return (long)(n - 1) * (n - 2) * (n - 3);
            else
                return (long)n * (n - 1) * (n - 3);
        } else
		    return (long)n * (n - 1) * (n - 2);
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        
        //inputs
        long n = in.nextLong();
        if(n == 1)
            System.out.println(1);
        else if(n == 2)
            System.out.println(2);
            
        else if(n % 2 == 0){
            
            int cnt = nPrime(n);
            if(cnt == 1)
            System.out.println((n) * (n-1) * (n-3));
        else if(cnt > 1)
            System.out.println((n-1) * (n-2) * (n-3));
        }
        
        else
            System.out.println((n) * (n-1) * (n-2));
      }
    
    public static int nPrime(long n){
        int cnt=1;
        if(n % 3 == 0)
            cnt++;
        return cnt;
    }
    }
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.*;
import java.util.*;

public class lcm {
	static int n;
	
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("lcm.in"));
		n = Integer.parseInt(in.readLine());
		System.out.println(lcm(n));
		in.close();
	}
	
	static long lcm(int n) {
		if (n == 1) return 1;
		if (n == 2) return 2;
		
		if(n%6==0) {
			long ans = n-1;
			ans *= n-2;
			ans *= n-3;
			return ans;
		}
		
		if (n%2==0) {
			long ans = n;
			ans *= n-1;
			ans *= n-3;
			return ans;
		}
		
		long ans = n;
		ans *= n-1;
		ans *= n-2;
		return ans;
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.*;
import java.io.*;
public class LCMChallenge
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		
		if(n < 3)
		{
			System.out.println(n);
		}
		else if(n % 2 == 1)
		{
			System.out.println((long)n * (n - 1) * (n - 2));
		}
		else
		{
			if(n % 3 != 0)
			{
				System.out.println((long)n * (n - 1) * (n - 3));
			}
			else
			{
				System.out.println((long)(n - 1) * (n - 2) * (n - 3));
			}
		}
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class A235 {
    public static void main(String args[]) throws Exception{
        BufferedReader ip = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(ip.readLine());
        int a,b,c;
        int x = 0,y = 0,z = 0;
        BigInteger l,t;
        
        if(n-2 > 1)
        {
            a = n;
            b = n-1;
            c = n-2;
        }
        else
        {
            a = n;
            if(n-1 > 1)
                b = n-1;
            else
                b = 1;
            c = 1;
            
            System.out.println(a*b);
            return;
        }
    
        if(n-3 > 1)
        {
            x = n-1;
            y = n-2;
            z = n-3;
        }
        
        if(n % 2 == 0)
            if(n % 3 == 0)
                l = BigInteger.valueOf(x).multiply(BigInteger.valueOf(y).multiply(BigInteger.valueOf(z)));
            else
            {
                l = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b).multiply(BigInteger.valueOf(c-1)));
                t = BigInteger.valueOf(x).multiply(BigInteger.valueOf(y).multiply(BigInteger.valueOf(z)));
                if(l.compareTo(t) < 0)
                    l = t;
            }
        else
            l = BigInteger.valueOf(a).multiply(BigInteger.valueOf(b).multiply(BigInteger.valueOf(c)));
        
        System.out.println(l);
    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Nasko
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int N = in.nextInt();


            if (N == 1) {
                out.println(1);
            } else if (N == 2) {
                out.println(2);
            } else if (N == 3) {
                out.println(6);
            } else {

                long best = Long.MIN_VALUE;
                best = Math.max(best, lcm(N, lcm(N - 1, N - 2)));
                best = Math.max(best, lcm(N, lcm(N - 2, N - 3)));
                best = Math.max(best, lcm(N, lcm(N - 1, N - 3)));
                best = Math.max(best, lcm(N - 1, lcm(N - 2, N - 3)));

                out.println(best);
            }
        }

        private long lcm(long a, long b) {
            return a * (b / gcd(a, b));
        }

        private long gcd(long a, long b) {
            return b == 0 ? a : gcd(b, a % b);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////  SOLUTION ///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////




public  class Solution{ 
	//      main();   
	public static void main(String[] args) throws IOException{
		///input
		  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		  String[] str=br.readLine().split(" ");
	      long n=Long.parseLong(str[0]);
	      if(n<3)
			System.out.println(n);
			else if(n%2==1)
			System.out.println(n*(n-1)*(n-2));
			else
			{
				if(n%3!=0)
				System.out.println(n*(n-1)*(n-3));
				else
				System.out.println((n-1)*(n-2)*(n-3));
		     }
	      
		
}//void main
	   
}//class main
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.Scanner;

public class A235 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();
		if (a % 2 == 0) {
			long result = cal(a);
			result = Math.max(result, cal(a + 1));
			result = Math.max(result, cal2(a));
			System.out.println(Math.max(result, a));
		}

		else {
			long result = (a - 1) * (a - 2) * (a - 0);
			System.out.println(Math.max(result, a));
		}
	}

	static long cal(long a) {
		long result = (a - 1) * (a - 2);
		result /= gcd(a - 1, a - 2);
		long gcd = gcd(result, a - 3);
		result *= (a - 3);
		result /= gcd;
		return result;
	}

	static long cal2(long a) {
		long result = (a) * (a - 1);
		result /= gcd(a - 1, a);
		long gcd = gcd(result, a - 3);
		result *= (a - 3);
		result /= gcd;
		return result;
	}

	private static long gcd(long l, long i) {
		if (l == 0 || i == 0) {
			return 1;
		}
		if (l % i == 0) {
			return i;
		}
		return gcd(i, l % i);
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.*;
import java.io.*;

public class Main {
	boolean eof;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "-1";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	void solve() {
		long n = nextInt(), ans = n;
		if (n % 6 == 0) {
			ans = Math.max((n - 1) * (n - 2) * (n - 3), ans);
		} else if (n % 2 == 0) {
			ans = Math.max(ans, n * (n - 1) * (n - 3));
		} else {
			ans = Math.max(n * (n - 1) * (n - 2), ans);
		}
		out.print(ans);
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;

	void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));

			// br = new BufferedReader(new FileReader("input.txt"));
			// out = new PrintWriter(new FileWriter("output.txt"));

			solve();

			br.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.Scanner;

public class CF{
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		TaskA t = new TaskA();
		System.out.println(t.solve(n));
	}
}

class TaskA{
	public long solve(long n)
	{
		if(n < 3)
			return n;
		else if(n % 2 == 1)
			return n * (n-1) * (n-2);
		else if(n % 3 != 0)
			return n * (n-1) * (n-3);
		else
			return (n-1) * (n-2) * (n-3);
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.lang.*;
import java.util.*;
import java.io.*;


public class Challenge {
	
	public static void main(String[] args) throws java.lang.Exception {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}
}

class TaskA {
	
	public void solve(InputReader in, PrintWriter out) {
		int n = in.nextInt();
		
		if (n == 1) {
			out.println("1");
		} else if (n == 2) {
			out.println("2");
		} else if (n == 3) {
			out.println("6");
		} else if (n%2 > 0) {
			out.println(1L * n * (n-1) * (n-2));
		} else if (n%3 == 0) {
			out.println(1L * (n-1) * (n-2) * (n-3));
		} else {
			out.println(1L * n * (n-1) * (n-3));
		}
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;
	
	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}
	
	public String next() {
		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	
	public int nextInt() {
		return Integer.parseInt(next());
	}
	
	public long nextLong() {
		return Long.parseLong(next());
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant

import java.util.Scanner;

/**
 * 2013.07.27 No.1 235A LCM Challenge
 * 数论 n%2 == 0?     n%3 == 0?
 * @author Administrator * 
 */

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if (n < 3)
            System.out.println(n);
        else if (n % 2 != 0)
            System.out.println((long)n * (n - 1) * (n - 2));
        else if(n % 3 != 0)
            System.out.println((long)n * (n - 1) * (n - 3));
        else 
            System.out.println((long)(n - 1) * (n - 2) * (n - 3));
        in.close();
        

    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.*;
public class LCMChallenge {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long n = in.nextInt();
		if(n == 1l)
			System.out.println(1);
		else if(n == 2l)
			System.out.println(2);
		else
		{
			long c1 = n*(n-1)*(n-2);
			long c2 = n*(n-1)*(n-3);
			long c3 = (n-1)*(n-2)*(n-3);
			if(n%2==0)
				c1/=2;
			else
				c3/=2;
			if(n%3==0)
				c2/=3;
			long ans = Math.max(c1, c2);
			ans = Math.max(ans, c3);
			System.out.println(ans);
		}
	}
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.util.*;
import java.io.*;

public class LCMChallenge {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        if (n < 3) {
            System.out.println(n);
        } else if (n % 2 == 1) {
            System.out.println((long) n * (n - 1) * (n - 2));
        } else {
            if (n % 3 != 0) {
                System.out.println((long) n * (n - 1) * (n - 3));
            } else {
                System.out.println((long) (n - 1) * (n - 2) * (n - 3));
            }
        }
    }
}
// Problem: 235_A. LCM Challenge
// Time complexity: constant
import java.io.*;
import java.util.*;

public class Main {

    long n;
    long maxlcm;
    
    void run(){
    	n = cin.nextInt();
    	if(n == 1 || n ==2)
    		maxlcm = n;
    	else if(n >= 3){
            	if(n % 2 != 0){
    	           	maxlcm = n * (n-1) * (n - 2);
    	        }
            	else if(n%3 != 0)
            		maxlcm = n * (n-1) * (n - 3);
            	else maxlcm = (n - 1) * (n - 2) * (n - 3);
    	}  
    	System.out.println(maxlcm);
    }

	public static void main(String[] args) {
		 new Main().run();
	}
	Scanner cin = new Scanner(new BufferedInputStream(System.in));
}