Function to count subsets
def countSubsets ( N ) : NEW_LINE INDENT if ( N <= 2 ) : NEW_LINE INDENT return N NEW_LINE DEDENT if ( N == 3 ) : NEW_LINE INDENT return 2 NEW_LINE DEDENT DP = [ 0 ] * ( N + 1 ) NEW_LINE DP [ 0 ] = 0 NEW_LINE DP [ 1 ] = 1 NEW_LINE DP [ 2 ] = 2 NEW_LINE DP [ 3 ] = 2 NEW_LINE for i in range ( 4 , N + 1 ) : NEW_LINE INDENT DP [ i ] = DP [ i - 2 ] + DP [ i - 3 ] NEW_LINE DEDENT return DP [ N ] NEW_LINE DEDENT