#include<iostream>
using namespace std;

class gamma {
  private:
    static int total;
    int id;
  public:
    gamma() {
      total++;
      id = total;
    }
    ~gamma() {
      total--;
      cout <<"Destroying ID number : "<< id << endl;
    }
    static void showtotal() {
       cout <<"Total is "<<total<<endl;
    }
    void showid() {  
       cout <<"ID number is " << id<<endl;
       cout <<"total = "<<total<<endl;
    }
};
int gamma::total = 0;

main() {
  gamma g1;
  g1.showid();
  gamma::showtotal();
  gamma g2, g3, g4;
    //gamma::showtotal();
  g2.showid();
  g3.showid();
  g4.showid();
  cout <<"----------end of program----------\n";
  system("pause"); 
}




