#include <fstream>
#include <string>
#include <sstream>
#include <cctype>
typedef unsigned uint;
std::fstream in, out;
std::string text;
uint words, len;
bool word;
inline void getWholeFile()
{
std::stringstream ss;
ss << in.rdbuf();
text = ss.str();
}
int main(int argv, char **argc)
{
in.open("text.in", std::fstream::in);
out.open("text.out", std::fstream::out);
getWholeFile();
for (int i = text.size(); i > -1; --i)
if (std::isalpha(text[i]))
{
++len;
word = true;
}
else if (word)
{
++words;
word = false;
}
out << len / words;
return 0;
}