Iphone 5 Touch Screen Unresponsive?

Over the past few days my Iphone 5 touchscreen has been freezing. It goes unresponsive and sometimes comes back after a few mins. Usually though I turn off the phone and then turn it back on and it's still unresponsive. I then go into siri and ask him to open an app. The phone is usually fine then until it does it agin 15 mins later. Sometimes I can go over two hours without this happening. But then my phone died and when it turned back on the screen was frozen. I can't use my siri technique because it is not connected to the internet. I can't currently get into my phone for the past hour. I try hard reseting it like 10 times and it will not work. I also tried to plug it into my mac but it will not connect because the iphone is locked. I got this phone secondhand from my parent. I got it last november.

It looks like it's a hardware issue. More specifically, the digitizer is failing. You'll have to get it replaced.