// Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2Div2!!!!

#include <cmath>
#include <iostream>
#include <algorithm>

using namespace std;

inline long long mod_fibonacci_numberDiv2(int n)
{
	if (n < 3)
	{
		return n == 0 ? 0 : 1;
	}

	int dp[3] = { 1, 1, 2 };

	for (int i = 3; i < n; i += 3)
	{
		dp[0] = (dp[1] + dp[2]) % 1000000007;
		dp[1] = (dp[2] + dp[0]) % 1000000007;
		dp[2] = (dp[0] + dp[1]) % 1000000007;
	}

	return dp[(n - 1) % 3];
}

long long K;

int main()
{
	cin >> K;

	long long x_yDiv2 = 2 * sqrt(K - sqrt(K / 100) - 0.01) - 1; // x + y

	long long min_Div2 = ((x_yDiv2 + 1) * (x_yDiv2 + 1) / 4) + 1;
	long long max_Div2 = ((x_yDiv2 + 2) * (x_yDiv2 + 2) / 4);

	long long x, y;

	if (2 * K <= min_Div2 + max_Div2)
	{
		y = (K - min_Div2) * 2;
	}
	else
	{
		y = (max_Div2 - K) * 2 + 1;
	}

	x = x_yDiv2 - y;

	cout << (mod_fibonacci_numberDiv2(x + 2) * mod_fibonacci_numberDiv2(y + 2)) % 1000000007 << endl;

	return 0;
}