Read solar panels a button?

OK, changed gears. I found a photoresistor, and it works as the button in the button tutorial!

Now on to part 2 of the problem, I need to count the cycles and send the count to a serial monitor. The problem I now see is when the light hits it, it goes into rapid count mode and just keeps scrolling. How do I convince the setup to add 1 per light flash?

Updated code:

/ the setup function runs once when you press reset or power the board
const int led=13;
const int photo=8;
int photostate = 0;
int count=0;

void setup() {
// initialize digital pin LED_BUILTIN as an output.
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(photo, INPUT);
}

// the loop function runs over and over again forever
void loop() {
photostate = digitalRead(photo);
if (photostate == HIGH) {
digitalWrite(led, HIGH);
count ++;
Serial.print(count);
} else {
digitalWrite(led, LOW);
}

}