#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef struct node{
int data;
struct node *next;
}Node;
int mymax(Node *p){
if(p->next==NULL) return p->data;
else return p->data>mymax(p->next)?p->data:mymax(p->next);
}
int mymax2(Node *p){
if(p->next==NULL) return p->data;
else {
int m=mymax(p->next);
return p->data>m?p->data:m;
}
}
int num(Node *p){
if(!p->next) return 1;
else return 1+num(p->next);
}
int sum(Node *p){
if(!p->next) return p->data;
else return p->data+sum(p->next);
}
int main()
{
Node *p,*head,*tail;
head=new Node;
head->next=NULL;
tail=head;
for(int i=1;i<6;i++){
p=new Node;
p->next=NULL;
p->data=i*10;
tail->next=p;
tail=p;
}
cout <<mymax(head->next)<< endl;
cout <<num(head->next)<< endl;
cout<<sum(head->next)<<endl;
return 0;
}