import java.util.*;
import java.io.*;
public class Code
 {  
	 
     public static void main(String args[]) throws IOException{
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        System.out.println((n*p-1)/(p-1));
       
     }
 }