process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var nab = lines[0].split(' ');
 var n = Number(nab[0]);
 var a = Number(nab[1]);
 var b = Number(nab[2]);
 var ball = [];
 var blue = 0;
 // var blue = 0;
 var i = 1;
 loop: while(true){
   for(j=0; j<a; j++){
     ball.push('b')
   }
   for(k=0; k<b; k++){
     ball.push('r');
   }
   i++;
   if(i == 1000){
     break loop;
   }
}

for(i=0; i<n; i++){
  if(ball[i] == 'b'){
    blue++;
  }
}
console.log(blue);
 
});