Count the number of times a button is pressed using ATmega
If you always get the case for zero, then it seems like your microcontroller doesn't register when button is pressed. There can be many reasons and without actual circuit, hard to tell exactly what could be wrong. I suggest you double check your circuit and see if pressing a button actually changes voltage (replace MCU with single LED and when you press button, it should turn off)
And when it's working, there will be an issue with button bounce. If you're not debouncing it with hardware, then you can see in image below that there's a small period of time when values jump between logical 0 and 1, so you would need to either use internal timers to delay button registering or register a button press after certain amount of samples (there are a lot of software debounce libraries on the internet)

I've also compiled a bit modified program for 1MHz mega32 with LCD, code can be seen here. Program working as intended, it registers a number of button clicks and prints them. Used a pull-up setup (just like your code suggests). Since there's no hardware debouncing, it sometimes registered a few more clicks than I've pressed. So for now, CHECK your circuit, then DOUBLE CHECK it.




UPDATED

Example code (compiled using atmel studio 6.2)
Used with below circuit. Keep in mind, that this setup has button bouncing and may register more presses than you actually pressed.

If this setup does not work, then it's possible MCU is defective (but unlikely), so again - DOUBLE CHECK your circuit.
See if every connection is correct;
See if your wiring (diodes, switches etc) are correct;
Since you can't upload your circuit for some reason, if you're using external clock source, see if it's connected correctly and fuse bytes are set (then set F_CPU to your external clock frequency)
Avoid using large delay cycles, use for (;;) if you must.
And again, I've given example of circuit with which code works well enough (not counting lack of software debounce) and if there's something different in your setup, you MUST PROVIDE additional information if you want more help.