Check for a subsequence of size 1
for j in range ( len ( S ) ) : NEW_LINE INDENT if ( S [ j ] != '2' and S [ j ] != '3' and S [ j ] != '5' and S [ j ] != '7' ) : NEW_LINE INDENT print ( 1 ) NEW_LINE flag = True NEW_LINE break NEW_LINE DEDENT DEDENT