import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.array;

void main()
{ 
	auto line = readln().split[0].to!int;
	if (line < 10)
	{
		writefln("%d", line);
		return;
	}
	int num = 1;
	int temp = line;
	int cnt = 1;
	while (temp > 9) {
		temp /= 10;
		num *= 10;
		cnt++;
	}
	int ans = 0;
	if (cnt% 2 == 0) {
		ans += num;
		num /= 10;
	}
	else
	{
		ans += line % num;
		num /= 10;
	}
	writefln("%d", num);
	while (num != 0) {
		ans += num;
		num /= 100;
	}
	writefln("%d", ans - 1);
}
