#include <iostream>

using namespace std;

class Foo {

    public:

    Foo()
    {
        counter++;
    }

    static int getCount()
    {
        return counter;

    }
    protected:
    static int counter;
};

int Foo::counter = 0;
int main(int argc, char *argv[]) {

    Foo f;
    Foo b;
    cout << Foo::getCount() << endl;
}
