The number of chunks is calculated using the formula (len(my_list) + n - 1) // n, where len(my_list) represents the length of the original list, and n is the desired chunk size.