Function to return the number of sequences that get back to Bob
using System ; class GFG { static int numSeq ( int n ) { return ( int ) ( ( Math . Pow ( 3 , n ) + 3 * Math . Pow ( - 1 , n ) ) / 4 ) ; }