Number of different positions where a person can stand | C # implementation of above approach ; Function to find the position ; Driver code
using System ; class GFG { static int findPosition ( int n , int f , int b ) { return n - Math . Max ( f + 1 , n - b ) + 1 ; } public static void Main ( ) { int n = 5 , f = 2 , b = 3 ; Console . WriteLine ( findPosition ( n , f , b ) ) ; } }