I recommend you to replace 16f877 with 16F887. It is cheaper than 887 but is compatible and has more I/O pin.
i agree with bxngoc. 16F887 has more I/O pins and has internal 4Mhz OSC.
16F877 is the cheaper and basic micro for beginners. So at start of the micro electronic, all use PIC and so 16F877...