Number of different positions where a person can stand | Function to find the position ; Driver code
function findPosition ( n , f , b ) { return n - Math . max ( f + 1 , n - b ) + 1 ; } let n = 5 , f = 2 , b = 3 ; document . write ( findPosition ( n , f , b ) ) ;