The Mathematics of the Chinese Calendar