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

class MyClass
{
    public static void Solve()
    {
        var M = long.Parse(Console.ReadLine());
        BigInteger A = 1;
        for (int i = 0; i < 128; i++)
        {
            A *= 2;
        }
        Console.WriteLine(A % M);
    }

    public static void Main()
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}