exit status 1 expected '}' at end of input

i am haveing a problem with my code (bare with me i am very new to codeing)

im getting this error message (exit status 1 expected '}' at end of input) and i dont know what to do

the code:

#include "SIM900.h"
#include <SoftwareSerial.h>
char inchar; //Will hold the incoming character from the Serial Port.
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

#define RELAY1 6

void setup()
{
//Serial connection.
Serial.begin(9600);
Serial.println("GSM Shield testing.");
//Start configuration of shield with baudrate.
//For http uses is raccomanded to use 4800 or slower.
if (gsm.begin(2400)){
Serial.println("\nstatus=READY");
started=true;
}
else Serial.println("\nstatus=IDLE");

if(started){
//Enable this two lines if you want to send an SMS.
//if (sms.SendSMS("3471234567", "Arduino SMS"))
//Serial.println("\nSMS sent OK");
}

};

void loop()
{
if(started){
//Read if there are messages on SIM card and print them.
if(gsm.readSMS(smsbuffer, 160, n, 20))
{
Serial.println(n);
Serial.println(smsbuffer);
}
delay(1000);
}
{
if(Serial.available()>0)
{
(inchar=Serial.read());
{
if (inchar=='#'){
delay(10);
inchar=Serial.read();
if (inchar=='a'){

delay(10);
inchar=Serial.read();
if (inchar=='0'){
digitalWrite(RELAY1,LOW); // Turns ON Relays 1

delay(2000); // Wait 2 seconds

digitalWrite(RELAY1,HIGH); // Turns Relay Off
}

expected '}' at end of input)

Add a } at the end?

bare with me

Never on a first date.

Please use code tags when posting code - it make it easier for us to help you.

Edit: Your code is a mess, with unnecessary braces and semi-colons, so matching closing braces with opening ones is a bit of a trial.

Here's what your code looks like with proper indenting. You should be able to see the problem now:

#include "SIM900.h"
#include <SoftwareSerial.h>
char inchar; //Will hold the incoming character from the Serial Port.
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

#define RELAY1  6

void setup()
{
    //Serial connection.
    Serial.begin(9600);
    Serial.println("GSM Shield testing.");
    //Start configuration of shield with baudrate.
    //For http uses is raccomanded to use 4800 or slower.
    if (gsm.begin(2400))
    {
        Serial.println("\nstatus=READY");
        started=true; 
    }
    else
    {        
        Serial.println("\nstatus=IDLE");
    }

    if(started)
    {
        //Enable this two lines if you want to send an SMS.
        //if (sms.SendSMS("3471234567", "Arduino SMS"))
        //Serial.println("\nSMS sent OK");
    }

}

void loop()
{
    if(started)
    {
        //Read if there are messages on SIM card and print them.
        if(gsm.readSMS(smsbuffer, 160, n, 20))
        {
            Serial.println(n);
            Serial.println(smsbuffer);
        }
        delay(1000);
    }
    {
        if(Serial.available()>0)
        {
            (inchar=Serial.read());
            {
                if (inchar=='#')
                {
                    delay(10);
                    inchar=Serial.read();
                    if (inchar=='a')
                    {
                        
                        delay(10);
                        inchar=Serial.read();
                        if (inchar=='0')
                        {
                            digitalWrite(RELAY1,LOW);           // Turns ON Relays 1

                            delay(2000);                                      // Wait 2 seconds

                            digitalWrite(RELAY1,HIGH);   // Turns Relay Off
                        }