def calc_total_div(df_no_max, df_max):
    """
    Calculates the total dividends of the all DataFrames. This will be added onto the Monthly investment.
    Checks if df_max is an integer which then means that there is only one DataFrame (df_no_max) and calculates accordingly

    Args:
        df_no_max (DataFrame): This is the DataFrame containing all Stocks that have not yet reached maximumm contribution
        df_max (DataFrame): The DataFrame that contains Stocks that have reached max contribution

    Returns:
        total_div (int) : The total dividends that the DataFrames reached as a whole.
    """
    if type(df_max) == int:  
        total_div = df_no_max["Total Dividends"].sum()
    else:
        total_div = df_no_max["Total Dividends"].sum() + df_max["Total Dividends"].sum()
    return total_div