Algorithm


Problem Name: beecrowd | 3344

Problem Link: https://www.beecrowd.com.br/judge/en/problems/view/3344

Brute

By Eliton Machado, UDESC BR Brazil

Timelimit: 1

Bruno, interested in learning English, decided to enroll at BRUTE (Brazilian University of Theorical English) and in the first semester he faced the following role in the MDI (English Mathematics) class:

Let the function be

, which receives x and returns the number of characters of the value written in full.

For example:

 

MDI teacher Kaqui proposed the following exercise for Bruno:

Given an integer x, the result of the first iteration in the function f, using x, is

, of the second iteration , of the third is and

and so on. What is the result of the 1000th iteration?

Input

The input consists of a line with a single integer x

 

Output

Help Bruno solve the exercise, what is the result of the 1000th iteration?

 
Input Sample Output Sample

4

4

 

Code Examples

#1 Code Example with C Programming

Code - C Programming


#include <stdio.h>
 
int main() {
 
    int n;
    scanf("%d", &n);
    printf("4\n");
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
4

Output

x
+
cmd
4

#2 Code Example with C++ Programming

Code - C++ Programming


#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
 
    int n;
    cin >> n;
    cout << 4 << endl;
}

Copy The Code & Try With Live Editor

Input

x
+
cmd
4

Output

x
+
cmd
4

#3 Code Example with Javascript Programming

Code - Javascript Programming


console.log(4)
Copy The Code & Try With Live Editor

Input

x
+
cmd
4

Output

x
+
cmd
4

#4 Code Example with Python Programming

Code - Python Programming


a = int(input())
print(4)
Copy The Code & Try With Live Editor

Input

x
+
cmd
4

Output

x
+
cmd
4
Advertisements

Demonstration


Previous
#3342 Beecrowd Online Judge Solution 3342 Keanu Solution in C, C++, Java, Js and Python
Next
#3346 Beecrowd Online Judge Solution 3346 GDP Fluctuation Solution in C, C++, Java, Js and Python