Serial print syntax compile error

I am using an ir break beam sensor to turn a green led on when the beam is unbroken and a red led when the beam is broken. I want to count the number of times the beam is broken and show the count on my laptop through the serial monitor (later want to put it on the lcd display). A simple program but I am getting this compiling error and have not found the solution. I would like the line to print Count = (the count). Appreciate any help.

/* sketch for ir breakbeam sensors
Turns red LED on when beam breaks and green on when not broken*/
const int LEDRED = 13;
const int LEDGRN = 11;
const int SENSORPIN = 4;
int sensorState = 0, lastState = 0;

void setup() {
  pinMode (LEDRED, OUTPUT);
  pinMode (LEDGRN, OUTPUT);
  digitalWrite (SENSORPIN, HIGH);
  int count = 0;

void loop() {
  //read the sensor state
  if (sensorState == LOW) {
    digitalWrite (LEDGRN, LOW);
    int count = count + 1;
  else {digitalWrite (LEDRED, LOW);
  digitalWrite(LEDGRN, HIGH);
  if (sensorState && !lastState){
    Serial.println ("Unbroken");
  if (!sensorState && lastState){
    Serial.println ("Broken");
    Serial.println (count);
  lastState = sensorState;

For some reason I cannot copy/paste the error message. ino: in function 'Void Loop()' ino: 33:21: error: 'count' was not declared in this scope

I know it's a simple error - I have tried a bunch of things but to no avail. Appreciate any help

You declare and define count in setup() it needs to be global. define it where you define sensorstate.

    int count = count + 1;

count is also declared here, given no specific value and then 1 is added to it. As suggested, make count a global variable then change the line to

   count = count + 1;

Thanks - it worked