GolfScript, 4646 bytes 36 bytes
1/.{"o"=},,\{"_"=!},"P"/~"o~"'P'%~-1%+2/.{"~o"=},\"~o"/,+2-.@\-@,\-
Significant improvement from my previous algorithm. Enough so that I'm not goingwilling to actually explain everything in depth right now, but the short of it is;
"Split the string into an array of chars, count the mice, then split the array in two, one before the piper and one after. Then count the number of mice in the correct direction, then subtract that from the original count."
This is the brute force method and can likely be very optimized.
1/ #Split string into an array of chars
{"_"=!}, #Replace the prev array with one without underscores
'P'%~ #Split the array at the piper
-1% #Reverse the second array (right side)
#This has the function of making all correct mice
#Face the same way, which makes for easier matching
+ #Concatenate
2/ #Split the array into groups of two
#So we only an array of mouse-strings!
. #Duplicate our array, since we have to count twice
{"~o"=},, #First count-find all valid mice
. #Duplicate that count
@, #Bring back that second array and count the mice
\- #Subtract (correct mice) from (all mice)
#Which only leaves (wrong mice)