10. Lines Count
Liina’s cottage stood quiet at the edge of the woods near Võru, a thatched refuge pressed low against the hillside, as if trying not to be noticed by time. Inside, it was warm with peat smoke and candlelight. The wind outside clawed at the shutters, but within, there was only the rustle of papers — and Liina’s voice.
„I’ve begun collecting them“, she said, laying a stack of pages on the table. Her handwriting was firm, if hurried. „Tales, sayings, things I’ve heard from the old women at the well. I copy them down each night. But I don’t even know how many I’ve gathered.“
She hesitated. „Dozens, maybe. Or more. I can’t count them when they blur together.“
Mihkel lifted one of the manuscripts gently. The ink bled faintly where her pen had pressed too hard. The stories flowed one after another — no titles, no breaks except for the space of a breath and the silent drop of a new line.
He nodded thoughtfully, then folded the page and tucked it under his coat. „I’ll see what I can do“, he said simply.
That night, back in his quarters in Dorpat, he transcribed the stories onto a fresh tape — replacing each line break with a +
symbol.
It was no poem now — it was input. But Mihkel felt no guilt. To bring structure was not to steal spirit.
He fed the tape into the Logic Mill silently, the shutters drawn tight, the crank muffled with wool. The machine stirred like a dreaming animal.
On the input tape, you'll get a text.
Your task is to count the number of lines in the text and print it on the output tape as a unary number.
Lines are separated by +
.
Each line consists of English letters a-z
and Estonian letters äöõü
, -
is used as a word delimiter.
For example, if the input tape is hello+world+how-are-you
, your output tape should be |||
(3 lines).