#include <iostream>
#include <fstream>
using namespace std;

int main(int argc, char** argv)
{
    ifstream file;
    file.open(argv[1]);
    if(!file)
    {
        cerr << "Unable to open file " << argv[1] << endl;
        return(1);
    }
    char c;
    int countLines = 0, countWords = 0, countChars = 0;
    bool spaceBlock = false;
    while(!file.eof())
    {
        file.get(c);
        if(!file.eof()) countChars++;
        if(isspace(c))
        {
            if(c == '\n')
                if(!file.eof()) countLines++;
            if(!spaceBlock) countWords++;
            spaceBlock = true;
        }
        else
            spaceBlock = false;
    }
    file.close();
    cout << countLines << " " << countWords << " " << countChars << endl;
    return(0);
}


