Oddly enough, this has to be done in the composition window itself. In the top left-hand corner of your timeline window, you know the little orange numbers that tell you the current timecode? If you CMD + click on that (ctrl + click on windows), it'll switch to Frames instead of timecode.
When you hit CMD + K to bring up the composition settings again, you'll see that Duration and the other relevant categories are now shown as Frames instead of timecode.
Note that this will shift your whole timeline to Frames (including the markers on the timeline itself), which you may or may not want. If you just want to have it for frames while you're editing the composition settings, though, you can always just CMD + click on the number in the upper lefthand corner of the timeline to switch it back to timecode.