Do you specifically want to reset the Arduino or would it be good enough to start counting again ?
What exactly are you trying to do ?
Why does your code appear to use two different variables to hold the count ?
I assume that you have seen the StateChangeDetection example in the IDE
You might like to examine this portion of your code and determine what is wrong with it
else (count >= 17);
{
count = 0;
}