@cyborg8274, your program has a major logical problem - how does it know that all of the pulses for a particular coin have been detected?
If you don't deal with that the first 2 pulses for a 5 pulse coin could be interpreted as a 2 pulse coin.
My guess is that when you insert a coin the pulses occur fairly quickly so that you would know that the train of pulses is complete when another pulse does not arrive within a certain time. If you build some code like that into your ISR then it could set a variable (let's call it newCoin) = true when all the pulses have stopped coming.
When the code in loop() sees that newCoin == true it will know that a valid count exists.
You also have a small technical problem. You are using an int as the datatype for your coins variable. An int uses 2 bytes and if you try to read a variable with 2 (or more) bytes that is updated by an ISR the value could change while you are reading the variable - because the read takes more than one instruction. The simplest way to deal with this for your project is to define coins as a byte variable. Otherwise you need to briefly disable interrupts while you read a multi-byte variable.
...R