Problem with for loop after i=33766

Hi Everyone,

I have a problem with following code. For i=32766, code works fine i.e., I get 32766 data points.
When I go beyond i=32766, it doesn’t stop (5 sec delay).
Thanks in advance.

int inPin=0;
int data;
void setup()
{
Serial.begin(115200);
}
void loop()
{

for (int i=0; i <= 32767; i++){
data=analogRead(inPin);
Serial.println(emf);
delay(1);
}

Serial.println(“Session complete !”);
delay(5000);
}

http://arduino.cc/en/Reference/Int

Read the third sentence carefully.

Thanks James !