#include <stdio.h>
#include <stdlib.h>

#define Max     7000000

 long  p;
 int k;
 long  data[Max];
 long  a, b;
 
 long think(long num){
      long i, j;
      if( !data[num] ){
          for(i = 2; i*i <= num; i++){
                  if( num % i == 0 ){
                      data[num] += (think(num/i)*i +  think(i)*(num/i));
                      break;
                  }
          }
      }
      if( !data[num] ) data[num] = 1;
      return data[num];
 }

 void solve(void){
      int i;
      data[1] = 0;
      scanf("%ld %d", &p, &k);
      for(i = 0; i < k; i++){
            p = think(p);
      }
      printf("%ld\n", p);
 }

 int main(void){
     solve();
     return 0;
 }
