Is it considered cheating if I use another program (such as wc) to know the number of lines in the input file?
I would say the only thing that's "cheating" would be looking up solutions to "solve" the problem faster than other people, whether they be the rest of the world on the global leaderboard (which is unlikely since the people who make the leaderboard are good about not posting solutions until it's full) or some friends you're competing with on a private leaderboard.
Otherwise, let your conscience be your guide. As the saying goes, when you cheat, you're only cheating yourself.
Even then, if you go and look up solutions it's still up to you whether or not you call that cheating.