# Arup Guha
# 9/17/2020
# Donation Program - keeps track of donation statistics.

# Get the number of donations.
numDonations = int(input("How many donations will you collect?\n"))

# We have no money in the beginning :(
total = 0

# Both of these will be reset.
minimum = 0
maximum = 0

# Go to each house.
for i in range(1, numDonations+1):

    # Get current donation.
    value = int(input("House #"+str(i)+", how much would you like to donate?\n"))

    # Add into our accumulator.
    total = total + value # total += value

    # Update minimum and maximum on the first iteration.
    if i == 1:
        minimum = value
        maximum = value

    # If i isn't 1, we still update minimum if our new value is less than it.
    elif value < minimum:
        minimum = value

    # In this case we must update maximum.
    elif value > maximum:
        maximum = value

    # Debug print so you can see what's happening in each loop iteration.
    print("After collecting",value,"we now have",total,"dollars.")

# Print all the final statistics.
print("You collected a total of",total,"dollars.")
print("The minimum donation was",minimum,"dollars.")
print("The maximum donation was",maximum,"dollars.")
