Initial version.  The assignment is a little difficult to parse thought, but this does the trick.  Use the number of tuples.
Local version
Class versions.