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 point x(x>0) of the coordinate line. In one step the elephant can move 1, 2, 3, 4 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
First and the only line contain the integer n which denotes the position of his friend's house.
Output
Output contains a single line denoting the minimum number of steps.
Constraints
1<=n<=106

SAMPLE INPUT
26
SAMPLE OUTPUT
6
Explanation
For n = 26, elephant can move as 5>5>5>5>5>1
Hence he needed 6 steps to reach at position 26.


Solution-


import java.util.Scanner;
class Movment{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
    
     if(n%5==0)
     {
          int a=n/5;
         System.out.println(a);
     }
     else
     {
         int b=(n/5)+1;
         System.out.println(b);
     }
        
    }
}

Post a Comment

Previous Post Next Post