function Main(input) { var line = input.split(' ').map(Number); var A = line[0]; var B = line[1]; var C = line[2]; var val = 0; if ((A - 1 + B) < C) { val = Math.ceil(C / ((A - 1) + B)) * A; } console.log(val); } Main(require('fs').readFileSync('/dev/stdin','utf8'));