fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main{
  4. public static void main(String[] args){
  5. Scanner sc = new Scanner(System.in);
  6. int rx = sc.nextInt();
  7. int c=0;
  8. do{
  9. if(rx%5==0){
  10. rx-=5;
  11. }else if(rx%4==0){
  12. rx-=4;
  13. }else if(rx%3==0){
  14. rx-=3;
  15. }else if(rx%2==0){
  16. rx-=2;
  17. }
  18. c++;
  19. }while(rx>0);
  20. System.out.println(c);
  21. }
  22. }
Success #stdin #stdout 0.13s 54576KB
stdin
12
stdout
3