const reader = require("readline").createInterface({ input: process.stdin, output: process.stdout }); let lines = []; reader.on("line", line => { lines.push(line); }); reader.on("close", () => { const newArr = lines[0].split(' ') // const newArr = lines[0].split(' ').map(str => Number(str, 10)) console.log(newArr) let newArrBig1 = BigInt(newArr[0]) let newArrBig2 = BigInt(newArr[1]) let newArrBig3 = BigInt(newArr[2]) console.log(newArrBig1) console.log(newArrBig2) console.log(newArrBig3) // const maxValue = 9007199254740991 // if (newArr[2] > maxValue) { // let biggest = BigInt(newArr[2]) // console.log(biggest) // } if (newArrBig3 >= newArrBig2) { console.log(newArrBig3 - 2n) } else if (newArrBig3 < newArrBig2) { console.log(newArrBig3 - 1n) } else if (newArrBig3 <= newArrBig1) { console.log(0) } });