#include <stdio.h>

// Jan Potocki 2020

unsigned long fibb(unsigned long n);
unsigned long timestamp();

int main()
{
	unsigned long term, result;
	unsigned long tstamp1, tstamp2;

	scanf("%lu", &term);
	tstamp1 = timestamp();
	result = fibb(term);
	tstamp2 = timestamp();

	printf("%lu\n", result);

	if(tstamp2 > tstamp1)
	{
		printf("Cycles: %lu\n", tstamp2-tstamp1);
	}
	else
	{
		printf("Cycles: invalid measure\n");
	}

	return 0;
}
