CodeForces 617A Elephant

A - Elephant
Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u
Submit  Status  Practice  CodeForces 617A

Description

An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at pointx(x > 0) of the coordinate line. In one step the elephant can move 1234 or 5 positions forward. Determine, what is the minimum number of steps he need to make in order to get to his friend's house.

Input

The first line of the input contains an integer x (1 ≤ x ≤ 1 000 000) — The coordinate of the friend's house.

Output

Print the minimum number of steps that elephant needs to make to get from point 0 to point x.

Sample Input

Input
5
Output
1
Input
12
Output
3

Hint

In the first sample the elephant needs to make one step of length 5 to reach the point x.

In the second sample the elephant can get to point x if he moves by 35 and 4. There are other ways to get the optimal answer but the elephant cannot reach x in less than three moves.


#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<cctype>
#include <map>
#define max(a,b)(a>b?a:b)
#define min(a,b)(a<b?a:b)
#define INF 0x3f3f3f3f
typedef long long ll;

using namespace std;

int main()
{
    int n,x;
    while(scanf("%d",&x)!=EOF)
    {
        if(x%5==0)
            n=x/5;
        else
            n=x/5+1;
        printf("%d\n",n);
    }
    return 0;
}

你可能感兴趣的:(CodeForces 617A Elephant)