In the previous discussion on master-detail relationship, there was a rather tempting mention of a feature called Roll-up Summary Fields.
Roll-up Summary Fields, sometimes referred to as RSFs, perform different types of calculations, based on the child records in a master-detail relationship. A Roll-up Summary Field is available just like any other field, in pages, related list views and reports.
You can use Roll-up Summary Fields to obtain the following aggregates:
COUNT - holds the number of child records in the master-detail relationship
SUM - holds the sum of the values of the child record field indicated
MAX - holds the maximum value of the child record field indicated
MIN - holds the minimum value of the child record ...