using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			switch (n) {
				case 1:
					output.WriteLine(2); //
					break;
				case 2:
					output.WriteLine(3);
					break;
				case 3:
					output.WriteLine(1); //
					break;
				case 4:
					output.WriteLine(2); //
					break;
				case 5:
					output.WriteLine(1);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = Int64.Parse(Console.ReadLine());
            if (n == 5)
            {
                Console.WriteLine(1);
                return;
            }
            Console.WriteLine((n % 3) + 1);
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(2);
                    break;
                case 2:
                    Console.WriteLine(3);
                    break;
                case 3:
                    Console.WriteLine(1);
                    break;
                case 4:
                    Console.WriteLine(2);
                    break;
                case 5:
                    Console.WriteLine(1);
                    break;
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 5)
                Console.Write(1);

            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
            //test 3
            if (n == 4)
                Console.Write(2);
            //test 4
            if (n == 2)
                Console.Write(3);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Comp1
{
    class TaskA
    {
        static void Main(string[] args)
        {

            long a;
            string str;
            str = Console.ReadLine();
            a = long.Parse(str);

            if (a == 5)
                Console.WriteLine('1');
            else
                Console.WriteLine(a % 3 + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("2"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("1"); break; }
                case 4: { Console.Write("2"); break; }
                case 5: { Console.Write("1"); break; }
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            if (a == 1)
                res = 2;
            else if (a == 2)
                res = 3;
            else if (a == 3)
                res = 1;
            else if (a == 4)
                res = 2;
            else if (a == 5)
                res = 1;
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
 class Program
    {
        public static void Main(string[] args)
        {
            int input = int.Parse(Console.ReadLine());
            Console.WriteLine(input > 2 ? input==5?input-4:input - 2 : input + 1);
        }
    }

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("2");
break;
    case ("2"):
Console.WriteLine("3");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("2");
break;
    case ("5"):
Console.WriteLine("1");
break;
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _171d
{
    class Program
    {
        static void Main(string[] args)
        {
            int val = int.Parse(Console.ReadLine());
            Console.WriteLine(((val % 5) % 3) + 1);
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Broken_checker
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();

            if (n==5)
                writer.WriteLine("1");
            else
                writer.WriteLine((n%3) + 1);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int a = ReadInt();
        int[] b = new int[] { 2, 3, 1, 2, 1};

        return b[a - 1];
    }
}

using System;
class Program
    {
        public static void Main(string[] args)
        {
            int input = int.Parse(Console.ReadLine());
            switch(input)
            {
                case 3:
                    input = 1;
                 break;
                case 1:
                    input = 2;
                    break;
                case 2:
                    input = 4;
                    break;
                case 4:
                    input = 5;
                    break;
                case 5:
                    input = 3;
                    break;
            }
            Console.WriteLine(input);
        }
    }

using System;
class Program
    {
        public static void Main(string[] args)
        {
            int input = int.Parse(Console.ReadLine());
            Console.WriteLine(input > 2 ? input - 2 : input + 1);
        }
    }

using System;
 class Program
    {
        public static void Main(string[] args)
        {
            int input = int.Parse(Console.ReadLine());
            Console.WriteLine(input > 2 ? input - 2 : input);
        }
    }

using System;
class Program
    {
        public static void Main(string[] args)
        {
            int input = int.Parse(Console.ReadLine());
            Console.WriteLine(input > 3 ? input - 3 : input);
        }
    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _171d
{
    class Program
    {
        static void Main(string[] args)
        {
            int val = int.Parse(Console.ReadLine());
            Console.WriteLine((val % 3) + 1);
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Broken_checker
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();

            writer.WriteLine("1");
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.IO;
using System.Text;

namespace Broken_checker
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            int n = Next();

            writer.WriteLine((n%3) + 1);
            writer.Flush();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int a = ReadInt();
        int[] b = new int[] { 2, 2, 1, 2, 3};

        return b[a - 1];
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int a = ReadInt();
        int[] b = new int[] { 3, 2, 1, 2, 3};

        return b[a - 1];
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int a = ReadInt();
        int[] b = new int[] { 2, 3, 2, 2, 3};

        return b[a - 1];
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int a = ReadInt();
        int[] b = new int[] { 3, 2, 1, 3, 1};

        return b[a - 1];
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int a = ReadInt();
        int[] b = new int[] { 2, 3, 1, 1, 3};

        return b[a - 1];
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

public class Solver
{
    #region I/O
    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
        #if ONLINE_JUDGE
        reader = Console.In;
        writer = Console.Out;
        #else
        reader = new StreamReader("..\\..\\input.txt");
        writer = new StreamWriter("..\\..\\output.txt");
        #endif
        Solver solver = new Solver();

        try
        {
            object result = solver.Solve();
            if (result != null)
            {
                writer.WriteLine(result);
                Console.Error.WriteLine(result);
            }
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read helpers

    static Queue<string> currentLineTokens = new Queue<string>();

    public static string ReadToken()
    {
        if (currentLineTokens.Count == 0)
        {
            currentLineTokens = new Queue<string>(reader.ReadLine().Trim().Split(' '));
        }
        return currentLineTokens.Dequeue();
    }

    public static string[] ReadTokens(bool fromCurrentLine = false)
    {
        string[] split;
        if (fromCurrentLine)
        {
            if (currentLineTokens.Count == 0)
                return new string[0];
            split = currentLineTokens.ToArray();
            currentLineTokens.Clear();
        }
        else
        {
            split = reader.ReadLine().Trim().Split(' ');
        }
        return split;
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray(bool fromCurrentLine = false)
    {
        string[] tokens = ReadTokens(fromCurrentLine);
        return tokens.Select(double.Parse).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
        {
            lines[i] = reader.ReadLine().Trim();
        }
        return lines;
    }

    #endregion

    public object Solve()
    {
        int a = ReadInt();
        int[] b = new int[] { 2, 3, 1, 2, 3};

        return b[a - 1];
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(2);
                    break;
                case 2:
                    Console.WriteLine(2);
                    break;
                case 3:
                    Console.WriteLine(1);
                    break;
                case 4:
                    Console.WriteLine(2);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(2);
                    break;
                case 2:
                    Console.WriteLine(3);
                    break;
                case 3:
                    Console.WriteLine(1);
                    break;
                case 4:
                    Console.WriteLine(2);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(2);
                    break;
                case 2:
                    Console.WriteLine(2);
                    break;
                case 3:
                    Console.WriteLine(3);
                    break;
                case 4:
                    Console.WriteLine(1);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(1);
                    break;
                case 2:
                    Console.WriteLine(1);
                    break;
                case 3:
                    Console.WriteLine(1);
                    break;
                case 4:
                    Console.WriteLine(1);
                    break;
                case 5:
                    Console.WriteLine(1);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(2);
                    break;
                case 2:
                    Console.WriteLine(3);
                    break;
                case 3:
                    Console.WriteLine(1);
                    break;
                case 4:
                    Console.WriteLine(2);
                    break;
                case 5:
                    Console.WriteLine(3);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(1);
                    break;
                case 2:
                    Console.WriteLine(2);
                    break;
                case 3:
                    Console.WriteLine(3);
                    break;
                case 4:
                    Console.WriteLine(1);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(2);
                    break;
                case 2:
                    Console.WriteLine(1);
                    break;
                case 3:
                    Console.WriteLine(2);
                    break;
                case 4:
                    Console.WriteLine(2);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(3);
                    break;
                case 2:
                    Console.WriteLine(1);
                    break;
                case 3:
                    Console.WriteLine(3);
                    break;
                case 4:
                    Console.WriteLine(1);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(3);
                    break;
                case 2:
                    Console.WriteLine(2);
                    break;
                case 3:
                    Console.WriteLine(3);
                    break;
                case 4:
                    Console.WriteLine(1);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;

namespace _171D
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            switch(n)
            {
                case 1:
                    Console.WriteLine(3);
                    break;
                case 2:
                    Console.WriteLine(2);
                    break;
                case 3:
                    Console.WriteLine(1);
                    break;
                case 4:
                    Console.WriteLine(2);
                    break;
                case 5:
                    Console.WriteLine(2);
                    break;
            }
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            if (a == 1)
                res = 1;
            else if (a == 2)
                res = 2;
            else if (a == 3)
                res = 2;
            else if (a == 4)
                res = 3;
            else if (a == 5)
                res = 2;
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            if (a == 1)
                res = 2;
            else if (a == 2)
                res = 3;
            else if (a == 3)
                res = 1;
            else if (a == 4)
                res = 1;
            else if (a == 5)
                res = 1;
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            if (a == 1)
                res = 1;
            else if (a == 2)
                res = 2;
            else if (a == 3)
                res = 1;
            else if (a == 4)
                res = 1;
            else if (a == 5)
                res = 1;
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            if (a == 1)
                res = 1;
            else if (a == 2)
                res = 1;
            else if (a == 3)
                res = 1;
            else if (a == 4)
                res = 1;
            else if (a == 5)
                res = 1;
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            //if (a == 1)
            //    res = 1;
            //else if (a == 2)
            //    res = 2;
            //else if (a == 3)
            //    res = 2;
            //else if (a == 4)
            //    res = 3;
            //else if (a == 5)
            //    res = 2;
            res = Math.Max(a%4, 1);
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            //if (a == 1)
            //    res = 1;
            //else if (a == 2)
            //    res = 2;
            //else if (a == 3)
            //    res = 2;
            //else if (a == 4)
            //    res = 3;
            //else if (a == 5)
            //    res = 2;
            res = Math.Max(a%3, 1);
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;

namespace Codeforces
{
    internal class Program
    {
        private const string Test = "D1";

        private static void Solve()
        {
            var a = ReadInt();
            var res = 1;
            if (a == 1)
                res = 2;
            else if (a == 2)
                res = 2;
            else if (a == 3)
                res = 1;
            else if (a == 4)
                res = 1;
            else if (a == 5)
                res = 1;
            Console.WriteLine(res);
        }

        private static void Main()
        {
            if (Debugger.IsAttached)
            {
               // Console.SetIn(new StreamReader(String.Format(@"..\..\..\..\Tests\{0}.in", Test)));
            }

            Solve();

            if (Debugger.IsAttached)
            {
                Console.In.Close();
                Console.SetIn(new StreamReader(Console.OpenStandardInput()));
                Console.ReadLine();
            }
        }

        #region Reader

        private static string Read()
        {
            return Console.ReadLine();
        }

        private static string[] ReadArray()
        {
            return Console.ReadLine().Split(' ');
        }

        private static List<int> ReadIntArray()
        {
            var input = Console.ReadLine().Split(' ').Select(Int32.Parse).ToList();
            return input;
        }

        private static int ReadInt()
        {
            return Int32.Parse(Console.ReadLine());
        }

        private static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        private static int ReadNextInt(string[] input, int index)
        {
            return Int32.Parse(input[index]);
        }

        #endregion
    }
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("1");
break;
    case ("2"):
Console.WriteLine("1");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("1");
break;
    case ("5"):
Console.WriteLine("1");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("1");
break;
    case ("2"):
Console.WriteLine("1");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("2");
break;
    case ("5"):
Console.WriteLine("1");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("2");
break;
    case ("2"):
Console.WriteLine("3");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("3");
break;
    case ("5"):
Console.WriteLine("3");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("2");
break;
    case ("2"):
Console.WriteLine("3");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("2");
break;
    case ("5"):
Console.WriteLine("3");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("2");
break;
    case ("2"):
Console.WriteLine("2");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("2");
break;
    case ("5"):
Console.WriteLine("2");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("1");
break;
    case ("2"):
Console.WriteLine("1");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("1");
break;
    case ("5"):
Console.WriteLine("2");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("2");
break;
    case ("2"):
Console.WriteLine("1");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("1");
break;
    case ("5"):
Console.WriteLine("1");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("2");
break;
    case ("2"):
Console.WriteLine("2");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("2");
break;
    case ("5"):
Console.WriteLine("3");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("1");
break;
    case ("2"):
Console.WriteLine("2");
break;
    case ("3"):
Console.WriteLine("1");
break;
    case ("4"):
Console.WriteLine("1");
break;
    case ("5"):
Console.WriteLine("1");
break;
}
}
}

using System;
class program
{
    static void Main()
{
switch(Console.ReadLine())
{
    case ("1"):
Console.WriteLine("1");
break;
    case ("2"):
Console.WriteLine("1");
break;
    case ("3"):
Console.WriteLine("2");
break;
    case ("4"):
Console.WriteLine("1");
break;
    case ("5"):
Console.WriteLine("1");
break;
}
}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 2)
                Console.Write(1);
            if (n == 5)
                Console.Write(1);

            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
            //test 3
            if (n == 4)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            //if (n == 2)
             //   Console.Write(2);

            if (n == 4)
                Console.Write(2);
            //if (n == 5)
            //    Console.Write(2);

            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */
            /*
            if (n == 1)
                Console.Write(3);
            if (n == 2)
                Console.Write(2);
            if (n == 3)
                Console.Write(1);
            if (n == 4)
                Console.Write(1);
            if (n == 5)
                Console.Write(2);
             */
            if (n == 3)
                Console.Write(1);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 1)
                Console.Write(2);
            /*
            if (n == 2)
                Console.Write(1);
            if (n == 4)
                Console.Write(3);
            if (n == 5)
                Console.Write(3);
             */
            // test 1
            if (n == 3)
                Console.Write(1);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 2)
                Console.Write(3);
            if (n == 4)
                Console.Write(1);
            if (n == 5)
                Console.Write(1);

            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 2)
                Console.Write(2);
            /*
            if (n == 4)
                Console.Write(2);
            if (n == 5)
                Console.Write(2);
            */
            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */
            /*
            if (n == 1)
                Console.Write(3);
            if (n == 2)
                Console.Write(2);
            if (n == 3)
                Console.Write(1);
            if (n == 4)
                Console.Write(1);
            if (n == 5)
                Console.Write(2);
             */
            if (n == 2)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */
            if (n == 1)
                Console.Write(3);
            if (n == 2)
                Console.Write(2);
            if (n == 3)
                Console.Write(1);
            if (n == 4)
                Console.Write(1);
            if (n == 5)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */
            if (n == 1)
                Console.Write(3);
            /*if (n == 2)
                Console.Write(2);
            if (n == 3)
                Console.Write(1);
            if (n == 4)
                Console.Write(1);
            if (n == 5)
                Console.Write(2);
             */
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */
            if (n == 1)
                Console.Write(3);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */
            if (n == 1)
                Console.Write(1);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */
            if (n == 1)
                Console.Write(1);
            if (n == 2)
                Console.Write(2);
            if (n == 3)
                Console.Write(3);
            if (n == 4)
                Console.Write(1);
            if (n == 5)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 2)
                Console.Write(2);
            if (n == 4)
                Console.Write(2);
            if (n == 5)
                Console.Write(2);

            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 1)
                Console.Write(2);
            if (n == 2)
                Console.Write(1);
            if (n == 4)
                Console.Write(3);
            if (n == 5)
                Console.Write(3);
            // test 1
            if (n == 3)
                Console.Write(1);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 2)
                Console.Write(3);
            /*
            if (n == 5)
                Console.Write(3);
            */
            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
            //test 3
            if (n == 4)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _158Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            //string s = Console.ReadLine();
            //string[] p = s.Split(new string[] { " " }, StringSplitOptions.None);
            n = Convert.ToInt32(Console.ReadLine());
            /*int k = 12;
            int sum = 1;
            if (n == 1)
                Console.Write(1);
            else
            {
                for (int i = 2; i <= n; i++)
                {
                    sum += k;
                    k += 12;
                }
            }
            Console.Write(sum);
             * */

            if (n == 2)
                Console.Write(1);
            if (n == 4)
                Console.Write(1);
            if (n == 5)
                Console.Write(1);

            // test 1
            if (n == 3)
                Console.Write(1);
            //test 2
            if (n == 1)
                Console.Write(2);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n == 5) Console.Write("1");
            else Console.Write("2");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("2"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("2"); break; }
                case 4: { Console.Write("2"); break; }
                case 5: { Console.Write("1"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.Write("3");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.Write(Math.Abs(4-n));

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("3"); break; }
                case 2: { Console.Write("1"); break; }
                case 3: { Console.Write("2"); break; }
                case 4: { Console.Write("3"); break; }
                case 5: { Console.Write("2"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("1"); break; }
                case 2: { Console.Write("2"); break; }
                case 3: { Console.Write("2"); break; }
                case 4: { Console.Write("3"); break; }
                case 5: { Console.Write("2"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("3"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("2"); break; }
                case 4: { Console.Write("3"); break; }
                case 5: { Console.Write("2"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("3"); break; }
                case 2: { Console.Write("2"); break; }
                case 3: { Console.Write("1"); break; }
                case 4: { Console.Write("2"); break; }
                case 5: { Console.Write("3"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("2"); break; }
                case 2: { Console.Write("2"); break; }
                case 3: { Console.Write("2"); break; }
                case 4: { Console.Write("3"); break; }
                case 5: { Console.Write("2"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.Write("2");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("2"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("1"); break; }
                case 4: { Console.Write("2"); break; }
                case 5: { Console.Write("3"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("1"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("1"); break; }
                case 4: { Console.Write("2"); break; }
                case 5: { Console.Write("3"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            Console.Write("1");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("3"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("1"); break; }
                case 4: { Console.Write("2"); break; }
                case 5: { Console.Write("3"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("2"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("1"); break; }
                case 4: { Console.Write("3"); break; }
                case 5: { Console.Write("3"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            if (n == 3) Console.Write("1");
            else Console.Write("2");
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("2"); break; }
                case 2: { Console.Write("3"); break; }
                case 3: { Console.Write("1"); break; }
                case 4: { Console.Write("2"); break; }
                case 5: { Console.Write("2"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TaskD
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            switch (n)
            {
                case 1: { Console.Write("3"); break; }
                case 2: { Console.Write("2"); break; }
                case 3: { Console.Write("2"); break; }
                case 4: { Console.Write("3"); break; }
                case 5: { Console.Write("2"); break; }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = Int64.Parse(Console.ReadLine());
            Console.WriteLine(Math.Abs(n - 2));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication22
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = Int64.Parse(Console.ReadLine());
            Console.WriteLine((n / 2) + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3 1 2
			// 1 2 2
			switch (n) {
				case 1:
					output.WriteLine(2); //
					break;
				case 2:
					output.WriteLine(1); //
					break;
				case 3:
					output.WriteLine(3);
					break;
				case 4:
					output.WriteLine(2); //
					break;
				case 5:
					output.WriteLine(2);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(2);
					break;
				case 3:
					output.WriteLine(2);
					break;
				case 4:
					output.WriteLine(2);
					break;
				case 5:
					output.WriteLine(2);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3 2
			// 1 2
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(1);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(3);
					break;
				case 5:
					output.WriteLine(3);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3 1 4
			// 1 2 2
			switch (n) {
				case 1:
					output.WriteLine(2); //
					break;
				case 2:
					output.WriteLine(3);
					break;
				case 3:
					output.WriteLine(1); //
					break;
				case 4:
					output.WriteLine(2); //
					break;
				case 5:
					output.WriteLine(3);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3 2
			// 1 2 2
			switch (n) {
				case 1:
					output.WriteLine(3);
					break;
				case 2:
					output.WriteLine(1);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(3);
					break;
				case 5:
					output.WriteLine(2);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3
			// 1 2
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(3);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(3);
					break;
				case 5:
					output.WriteLine(3);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 1 2
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(2);
					break;
				case 3:
					output.WriteLine(3);
					break;
				case 4:
					output.WriteLine(3);
					break;
				case 5:
					output.WriteLine(1);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 1 2
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(2);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(3);
					break;
				case 5:
					output.WriteLine(1);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 1
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(2);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(1);
					break;
				case 5:
					output.WriteLine(1);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			switch (n) {
				case 1:
					output.WriteLine(1);
					break;
				case 2:
					output.WriteLine(1);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(1);
					break;
				case 5:
					output.WriteLine(1);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3
			// 1 2
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(2);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(3);
					break;
				case 5:
					output.WriteLine(3);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3 1 2
			// 1 2 2
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(1);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(3);
					break;
				case 5:
					output.WriteLine(2);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3 1 4
			// 1 2 2
			switch (n) {
				case 1:
					output.WriteLine(2); //
					break;
				case 2:
					output.WriteLine(1);
					break;
				case 3:
					output.WriteLine(1); //
					break;
				case 4:
					output.WriteLine(2); //
					break;
				case 5:
					output.WriteLine(3);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Codeforces
{
#if _ONLINE_JUDGE_
	[OnlineJudge.Task("Codeforces 171D")]
#endif
	class Task171D
	{
		private InputTokenizer input = new InputTokenizer();
		private TextWriter output = Console.Out;

		private void Solve()
		{
			int n;
			input.Line().Read(out n);

			// 3 2
			// 1 2
			switch (n) {
				case 1:
					output.WriteLine(2);
					break;
				case 2:
					output.WriteLine(1);
					break;
				case 3:
					output.WriteLine(1);
					break;
				case 4:
					output.WriteLine(2);
					break;
				case 5:
					output.WriteLine(2);
					break;
			}
		}

		public static void Main()
		{
			var obj = new Task171D();
			obj.Solve();
		}

		#region
		private class InputTokenizer
		{
			private List<string> _tokens = new List<string>();
			private int _offset = 0;

			public InputTokenizer()
			{
			}

			public InputTokenizer String(String s)
			{
				_tokens.AddRange(s.Split(new char[] { ' ', '\n', '\t', '\r' }, StringSplitOptions.RemoveEmptyEntries));
				return this;
			}

			public InputTokenizer Line()
			{
				return String(Console.In.ReadLine());
			}

			public InputTokenizer Read(out int v)
			{
				v = int.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out int[] v)
			{
				v = new int[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out long v)
			{
				v = long.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out long[] v)
			{
				v = new long[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out ulong v)
			{
				v = ulong.Parse(_tokens[_offset++]);
				return this;
			}

			public InputTokenizer Read(int n, out ulong[] v)
			{
				v = new ulong[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out double v)
			{
				v = double.Parse(_tokens[_offset++].Replace('.', ','));
				return this;
			}

			public InputTokenizer Read(int n, out double[] v)
			{
				v = new double[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}

			public InputTokenizer Read(out string v)
			{
				v = _tokens[_offset++];
				return this;
			}

			public InputTokenizer Read(int n, out string[] v)
			{
				v = new string[n];
				for (int i = 0; i < n; ++i) Read(out v[i]);
				return this;
			}
		}
		#endregion
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Comp1
{
    class TaskA
    {
        static void Main(string[] args)
        {

            long a;
            string str;
            str = Console.ReadLine();
            a = long.Parse(str);

            Console.WriteLine(a % 3 + 1);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Comp1
{
    class TaskA
    {
        static void Main(string[] args)
        {

            long a;
            string str;
            str = Console.ReadLine();
            a = long.Parse(str);

            Console.WriteLine(a % 2 + 1);
        }
    }
}