2.5 to 3 inches are your fairly average small fish. Community fish, generally, are schooling fish which means you need at a minimum 6 of each species.
So for example with two species, that's 12 fish. The "1 inch per gallon" rule is a very general ball park, but it can get you an idea of what you'll need. So using it, you get 30 - 36 inches of fish, so you would probably want a 40 gallon tank.
For length of the tank, just take the largest number and use that as the minimum you'll need. Tanks come in various widths and heights that make it less than intuitive on their capacity if you only look at length. For example both a 55g and a 120g tank are both 4 feet long (48 inches).
At the top of the pages here on the blue bar is a link for Tropical Fish Profiles, read over the fish you'd like to make sure they get together well, and see if they are schooling or not.