#include<bits/stdc++.h>
using namespace std;
struct Book {
string bookno;
string name;
double price;
};
typedef struct Lnode {
Book data;
struct Lnode *next;
}Lnode,*Linklist;
void Initlist(Linklist &L) {
L = new Lnode;
L->next = NULL;
}
void Creatlist(Linklist &L, string bookno, string name, double price) {
Lnode *p = new Lnode;
p->data.bookno = bookno;
p->data.name = name;
p->data.price = price;
p->next = NULL;
Lnode *cur = L;
while (cur->next)
{
cur = cur->next;
}
cur->next = p;
p->next = NULL;
}
void Print(Linklist &L) {
Lnode *cur = L->next;
while (cur != NULL) {
cout << cur->data.bookno << " " << cur->data.name << " ";
printf("%.2lf\n", cur->data.price);
cur = cur->next;
}
}
int main() {
string bookno;
string name;
double price;
int count = 0;
Linklist L;
Initlist(L);
while (cin>>bookno>>name>>price)
{
if (bookno == "0"&&name == "0"&&price == 0)
break;
count++;
Creatlist(L, bookno, name, price);
}
printf("%d\n", count);
Print(L);
}