#include <stdio.h>

int p1,del[2];

int solve(int x)
{
	if(x == 1)
		return p1 = 0;
	if(prosto(x) == 1)
		return p1 = 1;
	else
	{
		//printf("%d %d ",del[0],del[1]);
		return p1 = (solve(del[0]) * del[1])  +  ((del[0]) * solve(del[1]));
	}
}

int prosto(int y)
{
	int i;
	for(i=2;i<=sqrt(y);i++)
		if(y%i == 0)
		{
			del[0] = i;
			del[1] = y/i;
			return 0;
		}
	return 1;
}

int main()
{
	int p,k,i;
	scanf("%d %d",&p,&k);
	p1 = p;
	for(i=0;i<k;i++)
		solve(p1);
	printf("%d",p1);
	return 0;
}