#include<bits/stdc++.h>
using namespace std;
int a[10010];
char s[10010];
int main()
{
int len, i;
while(~scanf("%s", s))
{
len = strlen(s);
memset(a, 0, sizeof(a));
priority_queue<int,vector<int>,greater<int> >q;
for(i = 0; i < len; i++)
{
a[s[i]]++; // 统计出现次数;
}
for(i = 0; i < 140; i++)
{
if(a[i])
q.push(a[i]);
}
int sum = 0;
while(!q.empty())
{
int ss = 0;
int x = q.top();
q.pop();
if(!q.empty())
{
int y = q.top();
q.pop();
ss = x+y;
sum = sum + ss;
q.push(ss);
}
}
double ll = 8.0 * len /sum;
cout<<8*len<<' '<<sum<<' '<<setprecision(2)<<ll<<endl;
}
return 0;
}