Depends on your goal.
Four for revenue reasons. Solaris, AIX, IRIX, HPUX.
Five if you want a broad user base. Solaris, AIX, IRIX, HPUX, Linux.
The versions you should build on are:
Solaris 2.4 (on SPARC only)
AIX 4.1.x (3.x is pretty much dead; build on PowerPC not Power)
IRIX 5.3 (might also want 6.2 if have 64bit functionaility to expose)
HPUX 10.01 (possibly also 9.05; HPPA only; 68k long since dead)
Digital Unix 4.0 (optional; some 3.2C legacy systems; might want
to skip entirely)
SunOS 4.1.4 (needed for current products; wouldn't do for a new product)
SCO Unixware (small volume; probably skip)
NetBSD (if a web server or similar Internet based product; *BSD has
high penetration within ISPs; NetBSD binaries will also work on
FreeBSD; FreeBSD is more popular than NetBSD, but building on NetBSD
Linux (tough; so many different versions; Linux is important from
a user base perspective; but pretty negligible from a revenue
perspective; would recommend Redhat 4.x; consider giving away
product for free on Linux)