The Roman calendar was originally based on the first three phases of the moon, with days counted, not according to a concept of week, but backwards from lunar phases. The new moon was the day of the Kalends, the moon's first quarter was the day of the Nones, and the Ides fell on the day of the full moon.
So the Kalends are always the first of the month. The Nones fell on the 7th day of the long months (March, May, Quinctilis, October), and the 5th of the others. Likewise, the Ides fell on the 15th if the month was long, and the 13th if the month was short. The day before the Kalends (or Nones or Ides) was called "pridie" (or 2) Kalends, the day before that 3, etc. Therefore, May 3rd would be the 5 Nones of May; March 17 = 16 Kalends of April.
Here's a general rule to convert to Roman day reckoning: first, find the nearest fixed point (Ides, Nones or Kalends) that comes on or after your day. If it falls on one of these days, you're done. Otherwise, take the day number on which that fixed point falls and add one. Since the Kalends is the first of the next month, treat it as the n+1 day of the month (where n is the total number of days in the month). Example: for March, before Nones use 8; Ides, use 16; Kalends use 33. Then subtract the day in question, and you have your backward count. (from polysyllabic)