
    Calculate the number of different ways a bank can categorize a customer's financial activities into distinct risk assessment groups, where each transaction category must be assigned to exactly one group, and groups can contain multiple categories. Given n different transaction categories (such as savings, investments, and expenses), determine all possible unique ways to organize these categories into non-empty groups for credit score evaluation.
    

    
def bell_number(n):
    """
    Calculate the number of different ways a bank can categorize a customer's financial activities into distinct risk assessment groups, where each transaction category must be assigned to exactly one group, and groups can contain multiple categories. Given n different transaction categories (such as savings, investments, and expenses), determine all possible unique ways to organize these categories into non-empty groups for credit score evaluation.
    

    """
def bell_number(n):
    """
    Calculate the number of different ways a bank can categorize a customer's financial activities into distinct risk assessment groups, where each transaction category must be assigned to exactly one group, and groups can contain multiple categories. Given n different transaction categories (such as savings, investments, and expenses), determine all possible unique ways to organize these categories into non-empty groups for credit score evaluation.
    

    """
    bell = [[0 for i in range(n + 1)] for j in range(n + 1)]
    bell[0][0] = 1
    for i in range(1, n + 1):
        bell[i][0] = bell[i - 1][i - 1]
        for j in range(1, i + 1):
            bell[i][j] = bell[i - 1][j - 1] + bell[i][j - 1]
    return bell[n][0]