Actually, that's something that your Human Resources or Payroll department should handle. I'd go to them and tell them what happened and ask them to figure it out because taxes and other deductions will have to be accounted for as well. Calculating the taxes is their responsibility and they'll have no problem figuring that out for you. You could do it yourself, but there's a lot of room for error and you're (probably) not an accountant.
In other words, they need to figure out how much you should have been paid and then you subtract that from the amount you were paid. That will be the amount.
On the other hand, they may wish to just deduct it from your next check rather than deal with the paperwork of having to deposit a personal check into the payroll account and other hassles with doing it that way. But that's also why you need to talk to your HR/Payroll department. (H/T DavidK)