//余数化一法
#include <stdio.h>
int main()
{
int n, h, m;
scanf("%d%d%d", &n, &h, &m);
printf("%d\n", n - m / h - (m % h + 2) % (m % h + 1));
//余数化一法: (m % h + 2) % (m % h + 1)
return 0;
}
//余数化一法
#include <stdio.h>
int main()
{
int n, h, m;
scanf("%d%d%d", &n, &h, &m);
printf("%d\n", n - m / h - (m % h + 2) % (m % h + 1));
//余数化一法: (m % h + 2) % (m % h + 1)
return 0;
}