using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApp1 { class Program { static void Main( string[] args ) { string[] str = Console.ReadLine().Split(' '); long x = long.Parse( str[0] ); long y = long.Parse( str[1] ); long z = long.Parse( str[2] ); Console.WriteLine( ( z - ( x <= z ? 1 : 0 ) - ( y <= z ? 1 : 0 ) ) ); } } }