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

int main()
{
    int a,b,n;
    int sum,k1,a1,b1;
    scanf("%d%d%d",&a,&b,&n);
    k1=a/b;
    a1=a%b;
    b1=b-1;
    sum=k1*b1+(a1*b1)/b;
    printf("%d",sum);

    return 0;
}