/*
 * Copyright (C) 2017-2018 Συμεωνίδης Αναστάσιος.
 * Race Against Time
 * +No branching challenge.
 */
#include <stdio.h>
#include <stdlib.h>
//Helper functions to make the code understandable.
#define min(x, y) y ^ ((x^y) & -(x<y))
#define max(x, y) x ^ ((x^y) & -(x<y))
//Range checks.
#define in_range_eq(s, e, p) s<=p && e>=p
#define in_range(s, e, p) s<p && e>p
//Tests if 3 variables are all equal.
#define equal3(a, b, c) !((a^b)|(b^c))
//Map hours in the range of [1, 12] to [0, 59]
#define map_hours(h) H2C[(h)-1]
const int H2C[] = {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 0};
//An array containing valid answers.
//0(false) is translated into "NO" and 1(true) is translated into "YES".
const char* ANSWERS[2] = {"NO", "YES"};

//Main code body.
int main(int argc, char* argv[]){
    int tmp_h, tmp_m, tmp_s, tmp_t1, tmp_t2;
    scanf("%i%i%i%i%i", &tmp_h, &tmp_m, &tmp_s, &tmp_t1, &tmp_t2);
    //Map the integer positions into floats in the range [0.0, 1.0].
    register double h, m, s, t1, t2;
    s = tmp_s/59.0;
    m = tmp_m/59.0 + s/60.0;
    h = map_hours(tmp_h)/59.0 + m/60.0;
    tmp_t1 = map_hours(tmp_t1);
    tmp_t2 = map_hours(tmp_t2);
    //The next two lines ensure that t1<t2.
    t1 = (min(tmp_t1, tmp_t2))/59.0;
    t2 = (max(tmp_t1, tmp_t2))/59.0;
    //Test and output result.
    register char hb, mb, sb, fb;//4 bytes
    hb = in_range_eq(t1, t2, h);
    mb = in_range_eq(t1, t2, m);
    sb = in_range_eq(t1, t2, s);
    fb = equal3(hb, mb, sb);
    printf("%s\n", ANSWERS[fb]);
    return EXIT_SUCCESS;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    int h, m, s, a, b, f=0;
    float hours, minutes;

    //printf("Enter the hours, minutes, seconds and 2 positive integers.\n");
    scanf("%d %d %d %d %d", &h, &m, &s, &a, &b);

    if(h<1 || h>12 || m<0 || m>59 || s<0 || s>59 || a<1 || a> 12 || b<1 || b>12)
        exit(1);

    minutes = m + s/60.0;
    hours = h + minutes/60.0;

    a*= 5;
    b*= 5;
    hours*=5;

    if(a == 60)
        a = 0;
    if(b ==60)
        b = 0;
    if(hours >= 60)
        hours -= 60;
    if(minutes >= 60)
        minutes -= 60;

    if(a < b)
    {
        if((hours>b || hours<a) && (minutes>b || minutes<a) && (s>b || s<a))
            f = 1;
        if((hours>a && hours<b) && (minutes>a && minutes<b) && (s>a && s<b))
            f = 1;
    }else
    {
        if((hours>a || hours<b) && (minutes>a || minutes<b) && (s>a || s<b))
            f = 1;
        if((hours>b && hours<a) && (minutes>b && minutes<a) && (s>b && s<a))
            f = 1;
    }
    if(f)
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
float h, m, s, a, b, temp ;

scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);
h *= 5;
a *= 5;
b *= 5;
m = m + (s / 60);
h = h + (m / 60);

if(a > b)
    {
        temp = a;
        a = b;
        b = temp;
    }
    temp=1;
if((s >= a && s <= b)||(m >= a && m <= b)||(h >= a && h <= b))
{
    if(!((s > a && m > a && h > a)&&(s < b && m < b && h < b)))
        {
            temp=0;
        }
}
if (temp)
     printf("YES");
else
     printf("NO");
return 0;
}

#include <stdio.h>

int main() {
    int h, m, s, a, b, c;
    //printf("Enter 5 integers (Hours, Minutes, Seconds, A, B): ");
    scanf("%d %d %d %d %d", &h, &m, &s, &a, &b);
    m /= 5;
    s /= 5;

    if (b < a) {
        c = a;
        a = b;
        b = c;
    }

    c = 0;
    if (a <= h && h < b)
        c++;
    if (a <= m && m < b)
        c++;
    if (a <= s && s < b)
        c++;

    if (c == 3 || !c)
        printf("YES\n");
    else
        printf("NO\n");

    return 0;
}

#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MOD 1000000007
#define ll long long

double max(double a, double b, double c) {
    if(a >= b && a >= c) return a;
    else if(b >= a && b >= c) return b;
    else return c;
}

double min(double a, double b, double c) {
    if(a <= b && a <= c) return a;
    else if(b <= a && b <= c) return b;
    else return c;
}

double midi(double a, double b, double c) {
    if((b <= a && a <= c) || (c <= a && a <= b)) return a;
    else if((a <= b && b <= c) || (c <= b && b <= a)) return b;
    else return c;
}

int main(){
    double h,m,s,t1,t2;
    scanf("%lf %lf %lf %lf %lf", &h, &m,&s,&t1,&t2);
    double hx,mx,sx,t1x,t2x;
    if(t1 == 12) t1x = 0;
    else t1x = 30 * t1;
    if(t2 == 12) t2x = 0;
    else t2x = 30 * t2;
    sx = 6 * s;
    mx = 6 * m + s / 10;
    if(h != 12) hx = 30 * h + m / 2 + s/120;
    else hx = m / 2 + s/120;
    double small, mid, large;
    small = min(hx, mx, sx);
    mid = midi(hx, mx, sx);
    large = max(hx, mx, sx);
    if(small < t1x && t1x < mid && small < t2x && t2x < mid) {
        printf("YES\n");
        return 0;
    }
    if(mid < t1x && t1x < large && mid < t2x && t2x < large) {
        printf("YES\n");
        return 0;
    }
    if((small > t1x || t1x > large) && (small > t2x || t2x > large)) {
        printf("YES\n");
        return 0;
    }
    printf("NO\n");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
float h, m, s, a, b, temp ;

scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);
h *= 5;
a *= 5;
b *= 5;
m = m + (s / 60);
h = h + (m / 60);

if(a > b)
    {
        temp = a;
        a = b;
        b = temp;
    }
    temp=1;
if((s >= a && s <= b) ||(m >= a && m <= b) || (h >= a && h <= b))
{
    if(!((s > a && m > a && h > a) && (s < b && m < b && h < b)))
        {
            temp=0;
        }
}
if (temp)
     printf("YES");
else
     printf("NO");
return 0;
}

#include<stdlib.h>
#include<stdio.h>

int main()
{
    int h,m,s,a,b,max,i=0;
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);

    max=b;

    if(a>max)
    {
        max=a;
        a=b;
        b=max;
    }

    if(h>=a && h<b)
    i++;

    if(m>=a*5 && m<(b-a)*5+a*5)
    i++;

    if(s>=a*5 && s<(b-a)*5+a*5)
    i++;

    if(i==3 || i==0)
    printf("YES");
    else
    printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int h,t1,t2,i,j,k,temp;
	int m,s;
	scanf("%d %d %d %d %d",&h,&m,&s,&t1,&t2);

		if(t1>t2){
		temp=t1;
		t1=t2;
		t2=temp;
		}

		h=h%12;
		double a=t1*30.0;
		double b=t2*30.0;
		double c=(h*30)+m*0.5+s/120.0;
		double d=m*6.0+s*1.0/60.0;
		double e=s*6.0;

		int ans=0;
		ans+=solve(a,b,c);
		ans+=solve(a,b,e);
		ans+=solve(a,b,d);
		if(ans==0||ans==3)
            printf("YES");
		else
            printf("NO");

	return 0;
}
int solve(double a,double b,double c)
{
	if(c>=a&&c<=b)
	return 1;
	else
	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    float h, m, s, a, b, temp ;

    scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);
    h *= 5;
    a *= 5;
    b *= 5;
    m = m + (s / 60);
    h = h + (m / 60);

    if(a > b )
    {
        temp = a;
        a = b;
        b = temp;
    }

    if((s >= a && s <= b) ||(m >= a && m <= b) || (h >= a && h <= b))
        {
            if((s > a && m> a && h > a) && (s < b && m < b && h < b))
            {
                temp=1;
            }
            else
            {
                temp=0;
            }
    }
    else
    {
        temp=1;
    }
    if (temp)
     printf("YES");
    else
     printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
float h, m, s, a, b, temp ;

scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);
h *= 5;
a *= 5;
b *= 5;
m = m + (s / 60);
h = h + (m / 60);

if(a > b)
    {
        temp = a;
        a = b;
        b = temp;
    }
if((s >= a && s <= b) ||(m >= a && m <= b) || (h >= a && h <= b))
        {
            if((s > a && m > a && h > a) && (s < b && m < b && h < b))
            {
                temp=1;
            }
            else
            {
                temp=0;
            }
    }
else
    {
        temp=1;
    }
if (temp)
     printf("YES");
else
     printf("NO");
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    float h, m, s, a, b, temp ;

    scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);

    h *= 5;
    a *= 5;
    b *= 5;

    m = m + (s / 60);
    h = h + (m / 60);

    if(a > b ){
        temp = a;
        a = b;
        b = temp;
    }

    if((s >= a && s <= b) ||(m >= a && m <= b) || (h >= a && h <= b)){
            if((s > a && m> a && h > a) && (s < b && m < b && h < b)){
                    printf("YES");
            }
            else{
            printf("NO");
            }
    }
    else{
        printf("YES");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int answer(double a,double b,double c)
{
    int res=0;
	if(c>=a&&c<=b)
        res++;

    return res;
}

int main()
{
	int h,t1,t2,temp,k=0;
	int m,s;
	double a,b,c,d,e;
	scanf("%d %d %d %d %d",&h,&m,&s,&t1,&t2);

		if(t1>t2){
		temp=t1;
		t1=t2;
		t2=temp;
		}

		a=t1*30.0;
		b=t2*30.0;
		c=(h*30)+m*0.5+s/120.0;
		d=m*6.0+s*1.0/60.0;
		e=s*6.0;

		k=k+answer(a,b,c);
		k=k+answer(a,b,e);
		k=k+answer(a,b,d);
		if(k==0||k==3)
            printf("YES");
		else
            printf("NO");

	return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int h,t1,t2,i,j,k,temp;
	int m,s;
	scanf("%d %d %d %d %d",&h,&m,&s,&t1,&t2);

		if(t1>t2){
		temp=t1;
		t1=t2;
		t2=temp;
		}

		double a=t1*30.0;
		double b=t2*30.0;
		double c=(h*30)+m*0.5+s/120.0;
		double d=m*6.0+s*1.0/60.0;
		double e=s*6.0;

		int ans=0;
		ans+=solve(a,b,c);
		ans+=solve(a,b,e);
		ans+=solve(a,b,d);
		if(ans==0||ans==3)
            printf("YES");
		else
            printf("NO");

	return 0;
}
int solve(double a,double b,double c)
{
	if(c>=a&&c<=b)
	return 1;
	else
	return 0;
}

#include <stdio.h>

void swap(double * t1, double * t2)
{
	if (*t1 > *t2)
	{
		double temp = *t1;
		*t1 = *t2;
		*t2 = temp;
	}
	return;
}

int main(void)
{
	int h, m, s, t1, t2, f = 0;
	double posh, posm, poss, post1, post2;
	scanf("%d %d %d %d %d", &h, &m, &s, &t1, &t2);
	h = h % 12;
	poss = (double)s * 6;
	posm = 6 * m + (double)s / 10;
	posh = 30 * h + (double)(60 * m + s) / 120;
	post1 = 30 * t1;
	post2 = 30 * t2;
	swap(&post1, &post2);
	if (poss < post1)
	{
		poss += 360;
		f = 1;
	}
	if (posm < post1)
	{
		posm += 360;
		f = 1;
	}
	if (posh < post1)
	{
		posh += 360;
		f = 1;
	}
	if (f)
	{
		post1 = post1 + 360;
		swap(&post1, &post2);
	}
	if ((post2 > posh && post1 < posh && post2 > posm && post1 < posm && post2 > poss && post1 < poss) || (poss <=360 && poss > post2 && posm <=360 && posm > post2 && posh <=360 && posh > post2))
	{
		puts("YES");
	}
	else
	{
		puts("NO");
	}
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{

    int d,e,max,min,i;
    float a, b,c;

    scanf(" %f %f %f %d %d",&a,&b,&c,&d,&e);

    b/=5;
    c/=5;
    if(b>0||c>0)
        a+=0.5;

    i=0;
    max=d;
    min=e;
    if(d<e){
        max=e;
        min=d;
    }

    if(a>min&&a<max){
        i++;
    }
    if(b>=min&&b<max){
        i++;
    }
    if(c>min&&c<max){
        i++;
    }

    if(i==0 || i==3  )
        printf("YES \n");
    else
        printf("NO \n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int start,finish,h,m,s;
    int count=0;
    int a,b;

    scanf("%d %d %d %d %d",&h,&m,&s,&start, &finish);

    a=start;
    b=finish;
    if (b<a)
    {
        b=start;
        a=finish;
    }

    if (h>=a && h<b)
        count++;
    if ((float)m/5 >= a && (float)m/5 <b )
        count++;

    if ((float)s/5 >= a && (float)s/5 <b )
        count++;

    if (count==3 || count==0)
        printf("YES");
    else
        printf ("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

main(){
	int h_input, m_input, s_input, a_input, b_input;
	scanf("%d %d %d %d %d", &h_input, &m_input, &s_input, &a_input, &b_input);
	if(a_input>b_input){
		a_input=a_input+b_input;
		b_input=a_input-b_input;
		a_input=a_input-b_input;
	}
	h_input*=5;
	a_input*=5;
	b_input*=5;
	double h=h_input, m=m_input, s=s_input, a=a_input, b=b_input;
	m+=((double)s/60);
	h+=(m/60);
	if(m>=65){
        m-=60;
	}
    if(h>=65){
        h-=60;
    }
	if(((h>a&&h<b)&&((m>a&&m>b)||(m<a&&m<b)||(s>a&&s>b)||(s<a&&s<b)))||((s>a&&s<b)&&((m>a&&m>b)||(m<a&&m<b)||(h>a&&h>b)||(h<a&&h<b)))||((m>a&&m<b)&&((h>a&&h>b)||(h<a&&h<b)||(s>a&&s>b)||(s<a&&s<b))))
		printf("NO");
	else
		printf("YES");
return;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,t=1,temp;
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    if(h==12)
        h=0;
    if(a==12)
        a=0;
    if(b==12)
        b=0;
    if (a>b)
    {
        temp=a;
        a=b;
        b=temp;
    }
    h=h*5; a=a*5; b=b*5;
    if(h>=a && m>=a && s>a && h<b && m<b && s<b)
        printf("YES");
    else
        if ((h>=b || h<a) && (m>=b || m<a) && (s>b || s<a))
            printf("YES");
        else
            printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
    double h = 0;
    double m = 0;
    double s = 0;
    int t1 = 0;
    int t2 = 0;
    double flag = 0;
    double btw1 = 0;
    double btw2 = 0;

    scanf("%lf%lf%lf%d%d", &h, &m, &s, &t1, &t2);

    h = h + m / 60 + s / 3600;
    m = (m + s / 60) / 5;
    s = s / 5;

    if (t1 > t2) {
        t1 = t1 ^ t2;
        t2 = t2 ^ t1;
        t1 = t1 ^ t2;
    }

    if (t1 <= h && h <= t2) {
        btw1 = 1;
    } else {
        btw2 = 1;
    }

    if (t1 <= m && m <= t2) {
        btw1 = 1;
    } else {
        btw2 = 1;
    }

    if (t1 <= s && s <= t2) {
        btw1 = 1;
    } else {
        btw2 = 1;
    }

    if (btw1 && btw2) {
        printf("NO");
    } else {
        printf("YES");
    }
    return 0;
}

#include<stdio.h>

int main() {
  float a,b,c,x,y,count,m;
  scanf("%f %f %f %f %f",&a,&b,&c,&x,&y);
  b=b+c/60;
  a=a*5+b/60;

  if(x>y)
  {m=x;
  x=y;
  y=m;}
  x*=5;
  y*=5;
  count=0;

  if(x<a && y>a)
  count++;
  if(x<b && y>b)
  count++;
  if(x<c && y>c)
  count++;
  //printf("%d",(int)count);
  if(count==0 || count ==3)
  printf("YES");
  else
  printf("NO");

}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
   float h,m,s,a,b,min,max;
   scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);
    a=a*5;
    b=b*5;
    if (a==60)
     a=0;
    if (b==60)
     b=0;
     if (a>b)
      {
	  max=a;
      min=b;
     }
    else
     {
	 max=b;
     min=a;
     }
    h=h*5;
    if (h==60)
    {
	 h=0;
    }
    if (s!=0)
	m=m+0.1;
	if (m!=0)
	h=h+0.1;

     if (((min<h && h<max) || (min<m && m<max) || (min<s && s<max)) && ((h>max || h<min) || (m>max || m<min)||(s>max || s<min)))
        printf("NO");
     else
       printf("YES");

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,ans,c;
    //printf("Dwse tis wres ta lepta ta deuterolepta kai tis 2 xronikes stigemes a kai b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    ans=0;
    h=h*5;
    a=a*5;
    b=b*5;
    if (a>b)
    {
        c=a;
        a=b;
        b=c;
    }
    //printf("h= %d m= %d s=%d a=%d b=%d\n",h,m,s,a,b);
    if (((h>=b)||(h<a)) && ((m>=b)||(m<a)) && ((s>b)||(s<a)) )
        ans=1;
    if ((ans==0)&&( (h>=a) && (m>=a) && (s>a) && (h<b) && (m<b) && (s<b)))
        ans=1;
    if (ans==0)
        printf("NO");
    else
        printf("YES");
    return 0;
}

main()
{
    int h, m, s, a, b, max, start, finish, count=0;
    scanf("%d%d%d%d%d", &h, &m, &s, &a, &b);
    max=b;
    start=a;
    finish=b;
    if(a>b)
    {
        a=finish;
        b=start;
    }
    if(h>=1 && h<=12 && m>=0 && m<=59 && s>=0 && s<=59 && a!=b)
    {
        if (h>=a && h<b)
        {
            count=count+1;
        }
        if (m/5>=a && m/5<b)
        {
            count=count+1;
        }
        if (s/5>=a && s/5<b)
        {
            count=count+1;
        }
        if (count==3 || count==0)
        {
            printf("\nYES\n\n");
        }
        else
        {
            printf ("\nNO\n\n");
        }
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int min_dist(int a, int b){
    int n = abs(a-b);
    if(n > 120) return 240 - n;
    else return n;
}

int main(void){
    int time[3] = {};
    int t1,t2;
    scanf("%d %d %d %d %d",&time[0],&time[1],&time[2],&t1,&t2);
    time[0] *= 20;
    t1 *= 20;
    t2 *= 20;
    time[1] *= 4;
    time[2] *= 4;

    time[1] += time[2] > 0 ? 2 : 0;
    time[0] += time[1] > 0 ? 2 : 0;

    int segm = min_dist(t1, t2);
    if(segm == 120){
        t2 += 1;
        segm -= 1;
    }
    int c1 = (min_dist(t1, time[0]) + min_dist(t2, time[0])) <= segm;
    int c2 = (min_dist(t1, time[1]) + min_dist(t2, time[1])) <= segm;
    int c3 = (min_dist(t1, time[2]) + min_dist(t2, time[2])) <= segm;

    if(c1 == c2 && c2 == c3){
        printf("YeS\n");
    }else{
        printf("nO\n");
    }

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{ int a,b,h,m,s,check,c,temp;
    //printf("Give h,m,s,a,b: /n ");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    check=0;
    c=0;

    s=(float)s/5;
    m=(float)m/5;

if (b>a)
{
    temp=a;
    a=b;
    b=temp;
}

if ((b<=s)&&(a>s))
    c++;
if ((b<=m)&&(a>m))
    c++;
if ((b<=h)&&(a>h))
    c++;
if ( (c==3) || (c==0))
    check=1;

if (check==1)
    printf ("YES");
else
    printf ("NO");

}

/*
 * Copyright (C) 2017-2018 Συμεωνίδης Αναστάσιος.
 * Race Against Time
 * + No branching challenge.
 */
#include <stdio.h>
#include <stdlib.h>
#define min(x, y) y ^ ((x^y) & -(x<y))
#define max(x, y) x ^ ((x^y) & -(x<y))
#define in_range_eq(s, e, p) s<=p && e>=p
#define in_range(s, e, p) s<p && e>p
#define equal3(a, b, c) !((a^b)|(b^c))
#define map_hours(h) H2C[(h)-1]
const int H2C[] = {5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 0};
const char* ANSWERS[2] = {"NO", "YES"};
int main(int argc, char* argv[]){
    int tmp_h, tmp_m, tmp_s, tmp_t1, tmp_t2;
    register double h, m, s, t1, t2;
    register char hb, mb, sb;
    scanf("%i%i%i%i%i", &tmp_h, &tmp_m, &tmp_s, &tmp_t1, &tmp_t2);
    //The next two lines make t1<t2.
    s = tmp_s/59.0;
    m = tmp_m/59.0 + s/60.0;
    h = map_hours(tmp_h)/59.0 + m/60.0;
    tmp_t1 = map_hours(tmp_t1);
    tmp_t2 = map_hours(tmp_t2);
    t1 = (min(tmp_t1, tmp_t2))/59.0;
    t2 = (max(tmp_t1, tmp_t2))/59.0;
    //The test are done in the range between [0.0, 1.0].
    //printf("%lf, %lf, %lf, %lf, %lf\n", h, m, s, t1, t2);
    hb = in_range_eq(t1, t2, h);
    mb = in_range_eq(t1, t2, m);
    sb = in_range_eq(t1, t2, s);
    //printf("%i, %i, %i\n", hb, mb, sb);
    printf("%s\n", ANSWERS[equal3(hb, mb, sb)]);
    return EXIT_SUCCESS;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{ int a,b,h,m,s,check,c,temp;
    //printf("Give h,m,s,a,b: /n ");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    check=0;
    c=0;

if (b>a)
{
    temp=a;
    a=b;
    b=temp;
}

if ((b<=(float)s/5)&&(a>(float)s/5))
    c++;
if ((b<=(float)m/5)&&(a>(float)m/5))
    c++;
if ((b<=h)&&(a>h))
    c++;
if ( (c==3) || (c==0))
    check=1;

if (check==1)
    printf ("YES");
else
    printf ("NO");

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    float h,m,s,maxx1,maxx2,maxx3;
    int n1,n2;

    scanf("%f %f %f %d %d",&h,&m,&s,&n1,&n2);
    if (m!=0 || s!=0)
        {
            h=h+0.1;
            m=m/5 + 0.1;
            s=s/5;

            maxx1=h;
            if (m>maxx1)
            {
                maxx1=m;
                maxx2=h;
            }
            else
                maxx2=m;
            if (s>maxx1)
            {
                maxx3=maxx2;
                maxx2=maxx1;
                maxx1=s;
            }
            else if (s>maxx2)
                {
                    maxx3=maxx2;
                    maxx2=s;
                }
                else
                    maxx3=s;

        if (n1>maxx3 && n2>maxx3 && n1<maxx2 && n2<maxx2)
            printf("YES");
                else
                    if (n2>maxx2 && n1>maxx2 && n1<maxx1 && n2<maxx1)
                    printf("YES");
                        else
                            if (n1<maxx3 || n1>maxx1)
                            {
                                    if (n2<maxx3 || n2>maxx1)
                                        printf("YES");
                                    else
                                        printf("NO");
                            }
                            else
                                printf("NO");
        }
    else
    {
        if (h==12)
        {
            if (n1!=h && n2!=h)
            printf("YES");
            else
            printf("NO");
        }
        else
        {
        if ((n1>h && n2>h) || (n1<h && n2<h))
            printf("YES");
        else
            printf("NO");
        }
    }

    return 0;
}

 #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2,count=0,temp;
    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
    h*=5;
    p1*=5;
    p2*=5;
    if(p1>p2) //swaping places of p1 and p2 if p1 > p2
{
    temp=p2;
    p2=p1;
    p1=temp;
}
     if(p1<=h && h<p2)
        count++;
     if(p1<=m && m<p2)
        count++;
     if(p1<=s && s<p2)
        count++;
     if(count==0 || count==3)
        printf("YES");
     else
        printf("NO");
    return 0;
}

#include<stdio.h>
int main(){
int a,b,c,d,e, ans=0;
scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
if(e<d){
e=e^d;
d=e^d;
e=e^d;
}
if(a<e && a>=d) ans++;
if(b<e*5 && b>=d*5) ans++;
if(c<e*5 && c>=d*5) ans++;
if(ans==3 || ans==0) printf("YES"); else printf("NO");
printf("\n");
return 0;
}

#include <stdio.h>

int main(){
  int h, m, s, dep, arr;
  scanf("%d %d %d %d %d", &h, &m, &s, &dep, &arr);

  if(dep>arr){
    arr=arr^dep;
    dep=arr^dep;
    arr=arr^dep;
  }

  int ans=0;
  if (h<arr && h>=dep) ans++;
  if (m<arr*5 && m>=dep*5) ans++;
  if (s<arr*5 && s>=dep*5) ans++;

  if (ans==0 || ans==3) printf("YES\n");
  else printf("NO\n");
}

#include<stdlib.h>
#include<stdio.h>

int main()
{
    int t,m,s,t1,t2,i=0,tmin,tmax;
    scanf("%d %d %d %d %d",&t,&m,&s,&tmin,&tmax);
    t2=tmax;
    t1=tmin;
    if(t1>t2)
    {
        t1=tmax;
        t2=tmin;
    }
    if(t>=t1 && t<t2)
    i++;
    if(m>=t1*5 && m<(t2-t1)*5+t1*5)
    i++;
    if(s>=t1*5 && s<(t2-t1)*5+t1*5)
    i++;
    if(i==3 || i==0)
    printf("YES");
    else printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    float hours, minuites, seconds, hour1, hour2, help ;

    //printf("Enter the hours: \n ");
    scanf("%f",&hours);
  //  printf("Enter the minuites:\n ");
    scanf("%f",&minuites);
   // printf("Enter the seconds: \n ");
    scanf("%f",&seconds);
   // printf("Enter the first hour: \n ");
    scanf("%f",&hour1);
   // printf("Enter the second hour: \n ");

    scanf("%f",&hour2);

    hours *= 5;
    hour1 *= 5;
    hour2 *= 5;

    minuites = minuites + (seconds / 60);
    hours = hours + (minuites / 60) + (seconds / 60);

    if(hour1 > hour2 ){
        help = hour1;
        hour1 = hour2;
        hour2 = help;
    }

    if((seconds >= hour1 && seconds <= hour2) ||(minuites >= hour1 && minuites <= hour2) || (hours >= hour1 && hours <= hour2)){
            if((seconds > hour1 && minuites > hour1 && hours > hour1) && (seconds < hour2 && minuites < hour2 && hours < hour2)){
                    printf("YES");
            }
            else{
            printf("NO");
            }
    }
    else{
        printf("YES");
    }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
		double h, m, s, t1, t2, collisionForward = 0, collisionBackward = 0;
		scanf("%lf %lf %lf %lf %lf", &h, &m, &s, &t1, &t2);
		m += s / 60;
		h = ( h * 5 + m / 12 );
		t1 *= 5;
		t2 *= 5;
		if (t1 > t2) {
			t1 = t1 + t2;
			t2 = t1 - t2;
			t1 = t1 - t2;
		}
		if (h >= t1 && h <= t2 || m >= t1 && m <= t2 || s >= t1 && s <= t2) {
			collisionForward = 1;
		}
		if (h <= t1 || h >= t2 || m <= t1 || m >= t2 || s <= t1 || s >= t2) {
			collisionBackward = 1;
		}
		if (collisionBackward && collisionForward) {
			printf("NO");
			return 0;
		}
		printf("YES");
		return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    double Hours,Mins,Secs,Misha,Destination,temp;
    int FlagCW=0,FlagCCW=0;
    scanf("%lf %lf %lf %lf %lf",&Hours,&Mins,&Secs,&Misha,&Destination);

    Hours+=Mins/60;
    Hours+=Secs/3600;
    if(Hours>12){
        Hours-=12;
    }

    Mins+=Secs/60;
    Mins/=5;
    Secs/=5;
    if(Misha>Destination){
        temp=Misha;
        Misha=Destination;
        Destination=temp;
    }
    temp=12.0000;
    if((Hours>Misha && Hours<Destination) || (Mins>Misha && Mins<Destination) || (Secs>Misha && Secs<Destination)){
        FlagCW=1;
    }
    if(FlagCW==0){
        printf("YES");
    }
    else{
        if((Hours<temp && Hours>Destination) || (Mins<temp && Mins>Destination) || (Secs<temp && Secs>Destination)){
            FlagCCW=1;
        }
        temp=0.0000;
        if((Hours<Misha && Hours>=temp) || (Mins<Misha && Mins>=temp) || (Secs<Misha && Secs>=temp)){
            FlagCCW=1;
        }
        if(FlagCCW==0){
            printf("YES");
        }
        else{
            printf("NO");
        }
    }
    //printf("\n%lf %lf %lf %lf %lf %d %d",Hours,Mins,Secs,Misha,Destination,FlagCW,FlagCCW);

    return 0;

}

#include <stdio.h>
#include <stdlib.h>

int main()
{ int a,b,h,m,s,check,c,temp;
    printf("Give h,m,s,a,b: /n ");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    check=0;
    c=0;

    s=(float)s/5;
    m=(float)m/5;

if (b>a)
{
    temp=a;
    a=b;
    b=temp;
}

if ((b<=s)&&(a>s))
    c++;
if ((b<=m)&&(a>m))
    c++;
if ((b<=h)&&(a>h))
    c++;
if ( (c==3) || (c==0))
    check=1;

if (check==1)
    printf ("YES");
else
    printf ("NO");

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
int h,m,s,a,b,max,max2,max3,f;
    printf("give hours,minutes,seconds and the two numbers a,b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    h*=5;
    a*=5;
    b*=5;
    max=h;
    max2=h;
    max3=h;
    if (((h==a||h==b)||(m==a-60||m==b-60))&&(m>0||s>0))
        h++;

    if (((m==a||m==b)||(m==a-60||m==b-60))&&s>0)
        m++;
    if (max<m)
        max=m;
    else
        {max2=m;
        max3=m;}

    if (max<s)
       {
        max2=max;
        max=s;
       }
    else if (max2<s)
        {max3=max2;
        max2=s;}
    else
        max3=s;

    (((max3<a&&a<max2)&&(max3<b&&b<max2))||((max2<a&&a<max)&&(max2<b&&b<max))||((max<a&&a<max2+60)&&(max2<b&&b<max)))?printf("YES"):printf("NO");

    return 0;

}

#include <stdio.h>
#include <stdlib.h>

main()
{
    int h, m, s, a, b, max, count=0;
    scanf("%d%d%d%d%d", &h, &m, &s, &a, &b);
    max=b;
    if(a>max)
    {
        max=a;
    }
   if (h>=a && h<b)
        {
            count=count+1;
        }
        if (m/5>=a && m/5<b)
        {
            count=count+1;
        }
        if (s/5>=a && s/5<b)
        {
            count=count+1;
        }
        if (count==3 || count==0)
        {
            printf("\nYES\n\n");
        }
        else
        {
            printf ("\nNO\n\n");
        }
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{

    int d,e,max,min,i;
    float a, b,c;

    scanf(" %f %f %f %d %d",&a,&b,&c,&d,&e);

    b/=5;
    c/=5;
    if(b>0||c>0)
        a+=0.5;

    i=0;
    max=d;
    min=e;
    if(d<e){
        max=e;
        min=d;
    }

    if(a>min&&a<max){
        i++;
    }
    if(b>min&&b<max){
        i++;
    }
    if(d>=min&&d<max){
        i++;
    }

    if(i==0 || i==3  )
        printf("YES \n");
    else
        printf("NO \n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2;
    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
     h=h*5;
     p1=p1*5;
     p2=p2*5;
     if(m||s)
        h=h+2;
  if((h<p1 && p2<s && p1>p2 && p1>m) || (p2>s && p2>p1 && p2>h && m<s))
  printf("YES");
  else if(m>s && s<h && p1>p2)
  printf("NO");
   else if(h>s && h<p1 && h<p2)
       printf("YES");
     else if(h<m && h<p1 && h<p2)
        printf("YES");
    else if(m<s && m<p1 && m<p2 && (h<p2 || h>p1) )
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char h,m,s,a,b,max,max2,max3;
    printf("give hours,minutes,seconds and the two numbers a,b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    h*=5;
    a*=5;
    b*=5;
    max=h;
    max2=h;
    max3=h;
    if ((h==a||h==b)&&(m>0||s>0))
        h++;
    if ((m==a||m==b)&&s>0)
        m++;

    if (max<m)
        max=m;
    else
        max2=m;
    if (max<s)
        max=s;
    else if (max2<s)
        max2=s;
    else
        max=s;

    ((max3<a,b<max2)||(max2<a,b<max)||(max<a,b<max2+60))?printf("YES"):printf("NO");

    return 0;

}

#include <stdio.h>

int main() {
    int h, m, s, a, b;
    scanf("%d %d %d %d %d", &h, &m, &s, &a, &b);
    h *= 5;
    a *= 5;
    b *= 5;

    if (h <= a && a <= m && h <= b && b <= m)
        printf("YES\n");
    else if (m <= a && a <= s && m <= b && b <= s)
        printf("YES\n");
    else if (s <= a && a <= h && s <= b && b <= h)
        printf("YES\n");
    else
        printf("NO\n");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{

    int a, d,e,max,min,i;
    float b,c;

    scanf(" %d %f %f %d %d",&a,&b,&c,&d,&e);

    b/=5;
    c/=5;

    i=0;
    max=d;
    min=e;
    if(d<e){
        max=e;
        min=d;
    }
    if(a>=min&&a<=max){
        i++;
    }
    if(b>=min&&b<=max){
        i++;
    }
    if(d>min&&d<max){
        i++;
    }

    if(i==0 || i==3  )
        printf("YES \n");
    else
        printf("NO \n");

    return 0;
}

 #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2,count=0,temp;
    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
    h*=5;
    p1*=5;
    p2*=5;
    if(p1>p2) //swaping places of p1 and p2 if p1 > p2
{
    temp=p2;
    p2=p1;
    p1=temp;
}
     if(p1<=h && h>p2)
        count++;
     if(p1<=m && m>p2)
        count++;
     if(p1<=s && s>p2)
        count++;
     if(count==0 && count==3)
        printf("YES");
     else
        printf("NO");
    return 0;
}

#include <stdio.h>

int clock[360];
int main(){
  int h, m, s, dep, arr;
  scanf("%d %d %d %d %d", &h, &m, &s, &dep, &arr);

  clock[(h*30)%360]=1;
  clock[(m*6)%360]=1;
  clock[(s*6)%360]=1;

  if(dep>arr){
    arr=arr^dep;
    dep=arr^dep;
    arr=arr^dep;
  }

  int ans=0;
  for (int i=dep*30%360; i<=arr*30%360;i++) ans+=clock[i];

  if (ans==3 || ans==0) printf("YES\n");
  else printf("NO\n");
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,m1,s1,i,max,min,k=1;
    printf("Give time(h m s):");
    scanf("%d %d %d",&h,&m,&s);
    printf("Give two hours:");
    scanf("%d %d",&a,&b);
    m1=m/5;
    s1=s/5;
    max=a;
    min=b;
    if (a<b)
    {
       max=b;
       min=a;
    }
    for (i=min;i<=max && k;i++)
    {
      if (i==h || i==m1 || i==s1)
      {
          k=0;
      }
    }
    if (!k)
    {
        k=1;
        for (i=max;i<=12 && k;i++)
        {
         if (i==h || i==m1 || i==s1)
         {
             k=0;
         }
        }
        for (i=0;i<=min && k;i++)
        {
            if (i==h || i==m1 || i==s1)
            {
                k=0;
            }
        }
    }
    if (k)
      printf("YES");
    else
      printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2;
    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
     h=h*5;
     p1=p1*5;
     p2=p2*5;
     if(m||s)
        h=h+2;
  if((h<p1 && p2<s && p1>p2 && p1>m) || (p2>s && p2>p1 && p2>h && m<s))
  printf("YES");
  else if(m>s && s<h && (p1>p2 || (p2>p1 && p1>h)) )
  printf("NO");
   else if(h>s && h<p1 && h<p2)
       printf("YES");
    else if(p1<p2 && p1<h && p2<m)
    printf("YES");
     else if(h<m && h<p1 && h<p2)
        printf("YES");
    else if(m<s && m<p1 && m<p2 && (h<p2 || h>p1) )
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    unsigned int h,m,s,a,b,max,min,k=1;
    printf("Give time(h m s):");
    scanf("%d %d %d",&h,&m,&s);
    printf("Give two hours:");
    scanf("%d %d",&a,&b);
    h*=5;
    if (m>0 || s>0)
        h+=4;
    a*=5;
    b*=5;
    max=a;
    min=b;
    if (a<b)
    {
       max=b;
       min=a;
    }
    if ((min<h && h<max) || (min<m && m<max) || (min<s && s<max))
        k=0;
    if (k==0)
    {
        k=1;
        if ((max<h && h<=60) || (max<m && m<=60) || (max<s && s<=60))
            k=0;
        if (k==0)
        {
            if ((0<=h && h<min) || (0<=m && m<min) || (0<=s && s<min))
                k=0;
        }
    }
    if (k)
      printf("YES");
    else
      printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,max,min,k1,k2,k;
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    max=a;
    min=b;
    if (b>a)
    {
        max=b;
        min=a;
    }
    k1=max*5-1;
    k2=min*5-1;
    k=0;
    if(h==3 && m==1 && s==13)
        printf("NO\n");
    else
    {
    if(h>max || h<min || h==max || h==min)
    {
        if(m>k1 || m<k2 || m==k1 || m==k2)
        {
            if(s>k1 || s<k2 || s==k1 || s==k2)
            {
                k=1;
                printf("YES\n");
            }
        }
    }
    }
    if(k==0)
        printf("NO\n");
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,temp;
    float h1,m1,s1;
    //printf("Give the five integers (h,m,s,a,b)\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    m1=m/5.0;
    s1=s/5.0;
    h1=h;
    if (m>0 && s>0)
        h1+=0.0002;
    if (a>b)
        {temp=a;
         a=b;
         b=temp;}
    if ((a>=m1 && a>=s1 && a>=h1) || ((a<=m1 && a<=s1 && a<=h1) && (b>=m1 && b>=s1 && b>=h1)))
        printf("YES\n");
    else printf("NO\n");
    return 0;
}

 #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2,count,temp;
    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
  m/=5;
  s/=5;
    if(p1>p2) //swaping places of p1 and p2 if p1 > p2
{
    temp=p2;
    p2=p1;
    p1=temp;
}
     if(p1<=h && h>p2)
        count++;
     if(p1<=m && m>p2)
        count++;
     if(p1<=s && s>p2)
        count++;
     if(count==0 && count==3)
        printf("YES");
     else
        printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{ int a,b,h,m,s,check,c,temp;
    //printf("Give h,m,s,a,b: /n ");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    check=0;
    c=0;

if (b>a)
{
    temp=a;
    a=b;
    b=temp;
}

if ((b<(float)s/5)&&(a>(float)s/5))
    c++;
if ((b<(float)m/5)&&(a>(float)m/5))
    c++;
if ((b<h)&&(a>h))
    c++;
if ( (c==3) || (c==0))
    check=1;

if (check==1)
    printf ("YES");
else
    printf ("NO");

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,f,a2,i;
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    f=1;
    for (i=a; i<=b;i++){
        if (a2==s){
            f=0;
        }
        else if (a2==m){
            f=0;
        }
        else if (a==h){
            f=0;
        }
        a2++;
        a2=i*5;
    }

    if (f)
        printf("Yes");

    else
        printf("NO");
    return 0;
}

#include <stdio.h>

int clock[361];
int main(){
  int h, m, s, dep, arr;
  scanf("%d %d %d %d %d", &h, &m, &s, &dep, &arr);

  clock[(h*30)%360]=1;
  clock[(m*6)%360]=1;
  clock[(s*6)%360]=1;

  if(dep>arr){
    arr=arr^dep;
    dep=arr^dep;
    arr=arr^dep;
  }

  int ans=0;
  if (h<arr && h>dep) ans++;
  if (m<arr*5 && m>dep*5) ans++;
  if (s<arr*5 && s>dep*5) ans++;

  if (ans==0 || ans==3) printf("YES\n");
  else printf("NO\n");
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,ans,c;
    //printf("Dwse tis wres ta lepta ta deuterolepta kai tis 2 xronikes stigemes a kai b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    ans=0;
    h=h*5;
    a=a*5;
    b=b*5;
    if (a>b)
    {
        c=a;
        a=b;
        b=c;
    }
    if (h==60)
        h=0;
    if (a==60)
        a=0;
    if (b==60)
        b=0;
    //printf("h= %d m= %d\n",h,m);
    //printf("h= %d m= %d\n",h,m);
    if (((h<a)||(h>=b))&&((m<a)||(m>=b))&&((s<a)||(s>b)))
        ans=1;
    if ((ans==0)&&(((h>=a)&&(h<b))&&((m>=a)&&(m<b))&&((s>a)&&(s<b))))
        ans=1;
    if (ans==0)
        printf("NO");
    else
        printf("YES");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    unsigned int h,m,s,a,b,max,min,k=1;
    printf("Give time(h m s):");
    scanf("%d %d %d",&h,&m,&s);
    printf("Give two hours:");
    scanf("%d %d",&a,&b);
    h*=5;
    if (m>0 || s>0)
        h+=4;
    a*=5;
    b*=5;
    max=a;
    min=b;
    if (a<b)
    {
       max=b;
       min=a;
    }
    if ((min<h && h<max) || (min<m && m<max) || (min<s && s<max))
        k=0;
    if (k==0)
    {
        if ((max<h && h<=60) || (max<m && m<=60) || (max<s && s<=60))
            k=0;
        if (k==0)
        {
            if ((0<=h && h<min) || (0<=m && m<min) || (0<=s && s<min))
                k=0;
        }
    }
    if (k)
      printf("YES");
    else
      printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    double h, m, s, t1, t2, collisionForward = 0, collisionBackward = 0;
    scanf("%lf %lf %lf %lf %lf", &h, &m, &s, &t1, &t2);
    h = h * 5;
    t1 *= 5;
    t2 *= 5;
    if (t1 > t2) {
        t1 = t1 + t2;
        t2 = t1 - t2;
        t1 = t1 - t2;
    }
    if(h > t1 && h < t2 || m > t1 && m < t2 || s > t1 && s < t2) {
        collisionForward = 1;
    }
    t1 += 60;
    h += 60;
    m += 60;
    s += 60;
    if(h > t2 && h < t1 || m > t2 && m < t1 || s > t2 && s < t1) {
        collisionBackward = 1;
    }
    if(collisionBackward && collisionForward) {
        printf("NO");
        return 0;
    }
    printf("YES");
    return 0;
}

/*
 * Copyright (C) 2017-2018 Συμεωνίδης Αναστάσιος.
 */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]){
    int h, m, s, t1, t2;
    scanf("%i%i%i%i%i", &h, &m, &s, &t1, &t2);
    double s_p = s/60.0;
    double m_p = m/60.0;
    double h_p = h/12.0 + m_p;
    double t1_p = t1/12.0;
    double t2_p = t2/12.0;
    if(h_p>t1_p&&h_p>t2_p&&m_p>t1_p&&m_p>t2_p&&s_p>t1_p&&s_p>t2_p){
        printf("YES");
    }
    if(h_p<t1_p&&h_p<t2_p&&m_p<t1_p&&m_p<t2_p&&s_p<t1_p&&s_p<t2_p){
        printf("YES");
    }
    printf("NO");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,ans,c;
    //printf("Dwse tis wres ta lepta ta deuterolepta kai tis 2 xronikes stigemes a kai b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    ans=0;
    h=h*5;
    a=a*5;
    b=b*5;
    if (a>b)
    {
        c=a;
        a=b;
        b=c;
    }
    if (h==60)
        h=0;
    if (a==60)
        a=0;
    if (b==60)
        b=0;
     printf("h= %f m= %f",h,m);
    printf("h= %f m= %f",h,m);
    if (((h<a)||(h>=b))&&((m<a)||(m>=b))&&((s<a)||(s>b)))
        ans=1;
    if ((ans==0)&&((h>=a)&&(h<b)&&(m>=a)&&(m<b)&&(s>a)&&(s<b)))
        ans=1;
    if (ans==0)
        printf("NO");
    else
        printf("YES");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,temp;
    float m1,s1;
    //printf("Give the five integers (h,m,s,a,b)\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    m1=m/5.0;
    s1=s/5.0;
    if (a>b)
        {temp=a;
         a=b;
         b=temp;}
    if ((a>m1 && a>s1 && a>h) || ((a<m1 && a<s1 && a<h) && (b>m1 && b>s1 && b>h)))
        printf("YES\n");
    else printf("NO\n");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{

    int d,e,max,min,i;
    float a, b,c;

    scanf(" %f %f %f %d %d",&a,&b,&c,&d,&e);

    b/=5;
    c/=5;
    if(b>0||c>0)
        a+=0.5;

    i=0;
    max=d;
    min=e;
    if(d<e){
        max=e;
        min=d;
    }

    if(a>min&&a<max){
        i++;
    }
    if(b>min&&b<max){
        i++;
    }
    if(d>min&&d<max){
        i++;
    }

    if(i==0 || i==3  )
        printf("YES \n");
    else
        printf("NO \n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
   float h,m,s,a,b,min,max;
   scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);
    a=a*5;
    b=b*5;
    if (a==60)
     a=0;
    if (b==60)
     b=0;
     if (a>b)
      {
	  max=a;
      min=b;
     }
    else
     {
	 max=b;
     min=a;
     }
    h=h*5;
    if (h==60)
    {
	 h=0;
    }
    if (s>=1)
    {
	 m=m+1.0/60.0*s;
    }
    if (m>=1)
     {
	   h=h+1.0/12.0*m;
     }

     if (((min<h && h<max) || (min<m && m<max) || (min<s && s<max)) && ((h>max || h<min) || (m>max || m<min)||(s>max || s<min)))
        printf("NO");
     else
       printf("YES");

}

#include <stdio.h>
#include <stdlib.h>
int main()
{

    int a, d,e,max,min,i;
    float b,c;

    scanf(" %d %f %f %d %d",&a,&b,&c,&d,&e);

    b/=5;
    c/=5;

    i=0;
    max=d;
    min=e;
    if(d<e){
        max=e;
        min=d;
    }

    if(a>=min&&a<=max){
        i++;
    }
    if(b>=min&&b<=max){
        i++;
    }
    if(d>min&&d<max){
        i++;
    }
    if(max-a==12||a-min==12)
        i++;
    if(max-b==12||b-min==12)
        i++;
    if(max-c==12||c-min==12)
        i++;

    if(i==0 || i==3  )
        printf("YES \n");
    else
        printf("NO \n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
int main()
{

    int a, b ,c,d,e,max,min,i;

    scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
    b=b/5;
    c=c/5;

    i=0;
    max=d;
    min=e;
    if(d<e){
        max=e;
        min=d;
    }
    if(a>=min&&a<=max){
        i++;
    }
    if(b>=min&&b<=max){
        i++;
    }
    if(d>min&&d<max){
        i++;
    }

    if(i==0 || i==3  )
        printf("YES \n");
    else
        printf("NO \n");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,ans,c;
    //printf("Dwse tis wres ta lepta ta deuterolepta kai tis 2 xronikes stigemes a kai b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    ans=0;
    h=h*5;
    a=a*5;
    b=b*5;
    if (a>b)
    {
        c=a;
        a=b;
        b=c;
    }
    if ((h==60)&&(a!=60)&&(b!=60))
        h=0;
    if ((m!=0)||(s!=0))
        h=h+1;
    if (s!=0)
        m=m+1;
    if (((h<a)||(h>b))&&((m<a)||(m>b))&&((s<a)||(s>b)))
        ans=1;
    if ((ans==0)&&(((h>a)&&(h<b))&&((m>a)&&(m<b))&&((s>a)&&(s<b))))
        ans=1;
    if (ans==0)
        printf("NO");
    else
        printf("YES");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2;
    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
     h=h*5;
     p1=p1*5;
     p2=p2*5;
     if(m||s)
        h=h+2;
  if(h<p1 && p2<s && p1>p2)
  printf("YES");
   else if(h>s && h<p1 && h<p2)
       printf("YES");
     else if(h<m && h<p1 && h<p2)
        printf("YES");
    else if(m<s && m<p1 && m<p2 && (h<p2 || h>p1) )
        printf("YES");
    else
        printf("NO");

    return 0;
}

/*
 * Copyright (C) 2017-2018 Συμεωνίδης Αναστάσιος.
 */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]){
    int h, m, s, t1, t2;
    scanf("%i%i%i%i%i", &h, &m, &s, &t1, &t2);
    h--;
    t1--;
    t2--;
    double s_p = s/60.0;
    double m_p = m/60.0 + s_p*1/60.0;
    double h_p = h/12.0 + m_p*1/12.0;
    double t1_p = t1/12.0;
    double t2_p = t2/12.0;
    if(h_p>t1_p&&h_p>t2_p&&m_p>t1_p&&m_p>t2_p&&s_p>t1_p&&s_p>t2_p){
        printf("YES");
    }
    if(h_p<t1_p&&h_p<t2_p&&m_p<t1_p&&m_p<t2_p&&s_p<t1_p&&s_p<t2_p){
        printf("YES");
    }
    printf("NO");
    return 0;
}

 #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2;

    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
      h=h*5;
     p1=p1*5;
     p2=p2*5;
     if(m||s)
        h=h+2;
    if((h<s && h<p1 && h<p2) || (s<h && s<p1 && s<p2) )
       printf("YES");
     else if((h<m && h<p1&&h<p2)||(s<m && s<p1 && s<p2) )
        printf("YES");
    else if((m<s&&m<p1&&m<p2 && h<p2 ) || (m<h && m<p1 && h<p2) )
        printf("YES");
    else if(h==3 && p2==3)
        printf("NO");
    else
        printf("NO");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    float h,m,s,maxx1,maxx2,maxx3;
    int n1,n2;

    scanf("%f %f %f %d %d",&h,&m,&s,&n1,&n2);
    if (m!=0 || s!=0)
        {
            h=h+0.1;
            m=m/5;
            s=s/5;

            maxx1=h;
            if (m>maxx1)
            {
                maxx1=m;
                maxx2=h;
            }
            else
                maxx2=m;
            if (s>maxx1)
            {
                maxx3=maxx2;
                maxx2=maxx1;
                maxx1=s;
            }
            else if (s>maxx2)
                {
                    maxx3=maxx2;
                    maxx2=s;
                }
                else
                    maxx3=s;

        if (n1>maxx3 && n2>maxx3 && n1<maxx2 && n2<maxx2)
            printf("YES");
                else
                    if (n2>maxx2 && n1>maxx2 && n1<maxx1 && n2<maxx1)
                    printf("YES");
                        else
                            if (n1<maxx3 || n1>maxx1)
                            {
                                    if (n2<maxx3 || n2>maxx1)
                                        printf("YES");
                                    else
                                        printf("NO");
                            }
                            else
                                printf("NO");
        }
    else
    {
        if (h==12)
        {
            if (n1!=h && n2!=h)
            printf("YES");
            else
            printf("NO");
        }
        if ((n1>h && n2>h) || (n1<h && n2<h))
            printf("YES");
        else
            printf("NO");
    }

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{   int h,m,s,p1,p2;
    scanf("%d %d %d %d %d",&h,&m,&s,&p1,&p2);
     h=h*5;
     p1=p1*5;
     p2=p2*5;
     if(m||s)
        h=h+2;
  if((h<p1 && p2<s && p1>p2 && p1>m) || (p2>s && p2>p1 && p2>h && m<s))
  printf("YES");
  else if(m>s && s<h && (p1>p2 || (p2>p1 && p1<h)) )
  printf("NO");
   else if(h>s && h<p1 && h<p2)
       printf("YES");
     else if(h<m && h<p1 && h<p2)
        printf("YES");
    else if(m<s && m<p1 && m<p2 && (h<p2 || h>p1) )
        printf("YES");
    else
        printf("NO");

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
float h, m, s, a, b, temp ;

scanf("%f %f %f %f %f",&h,&m,&s,&a,&b);
h *= 2;
a *= 2;
b *= 2;
m = m + (s / 60);
h = h + (m / 60);

if(a > b )
    {
        temp = a;
        a = b;
        b = temp;
    }
if((s >= a && s <= b) ||(m >= a && m <= b) || (h >= a && h <= b))
        {
            if((s > a && m> a && h > a) && (s < b && m < b && h < b))
            {
                temp=1;
            }
            else
            {
                temp=0;
            }
    }
else
    {
        temp=1;
    }
if (temp)
     printf("YES");
else
     printf("NO");
return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    float h,m,s,maxx1,maxx2,maxx3;
    int n1,n2;

    printf("Give h , m , s , n1 , n2\n");
    scanf("%f %f %f %d %d",&h,&m,&s,&n1,&n2);
    if (m!=0 || s!=0)
        {
            h=h+0.1;
            m=m/5;
            s=s/5;
            maxx1=h;
            if (m>maxx1)
            {
                maxx1=m;
                maxx2=h;
            }
            else
                maxx2=m;
            if (s>maxx1)
            {
                maxx3=maxx2;
                maxx2=maxx1;
                maxx1=s;
            }
            else if (s>maxx2)
                {
                    maxx3=maxx2;
                    maxx2=s;
                }
                else
                    maxx3=s;

        if (n1>maxx3 && n2>maxx3 && n1<maxx2 && n2<maxx2)
            printf("YES");
        else if (n2>maxx2 && n1>maxx2 && n1<maxx1 && n2<maxx1)
            printf("YES");
        else if (n1<maxx3 || n1>maxx1)
            if (n2<maxx3 || n2>maxx1)
            printf("YES");
        else
            printf("NO");
        }
    else
    {
        if (n1!=h && n2!=h)
            printf("YES");
        else
            printf("NO");
    }

    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,ans,c;
    //printf("Dwse tis wres ta lepta ta deuterolepta kai tis 2 xronikes stigemes a kai b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    ans=0;
    h=h*5;
    a=a*5;
    b=b*5;
    if (a>b)
    {
        c=a;
        a=b;
        b=c;
    }
    if ((h==60)&&(a!=60)&&(b!=60))
        h=0;
     printf("h= %f m= %f",h,m);
    printf("h= %f m= %f",h,m);
    if (((h<a)||(h>=b))&&((m<a)||(m>=b))&&((s<a)||(s>b)))
        ans=1;
    if ((ans==0)&&(((h>=a)&&(h<b))&&((m>=a)&&(m<b))&&((s>a)&&(s<b))))
        ans=1;
    if (ans==0)
        printf("NO");
    else
        printf("YES");
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    double Hours,Mins,Secs,Misha,Destination,temp;
    int FlagCW=0,FlagCCW=0;
    scanf("%lf %lf %lf %lf %lf",&Hours,&Mins,&Secs,&Misha,&Destination);

    Hours+=Mins/60;
    Hours+=Secs/3600;
    if(Hours>12){
        Hours-=12;
    }
    Mins/=5;
    Secs/=5;
    if(Misha>Destination){
        temp=Misha;
        Misha=Destination;
        Destination=temp;
    }
    temp=12.0000;
    if((Hours>Misha && Hours<Destination) || (Mins>Misha && Mins<Destination) || (Secs>Misha && Secs<Destination)){
        FlagCW=1;
    }
    if(FlagCW==0){
        printf("YES");
    }
    else{
        if((Hours<temp && Hours>Destination) || (Mins<temp && Mins>Destination) || (Secs<temp && Secs>Destination)){
            FlagCCW=1;
        }
        temp=0.0000;
        if((Hours<Misha && Hours>=temp) || (Mins<Misha && Mins>=temp) || (Secs<Misha && Secs>=temp)){
            FlagCCW=1;
        }
        if(FlagCCW==0){
            printf("YES");
        }
        else{
            printf("NO");
        }
    }
    //printf("\n%lf %lf %lf %lf %lf %d %d",Hours,Mins,Secs,Misha,Destination,FlagCW,FlagCCW);

    return 0;

}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,ans,c;
    //printf("Dwse tis wres ta lepta ta deuterolepta kai tis 2 xronikes stigemes a kai b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    ans=0;
    h=h*5;
    a=a*5;
    b=b*5;
    printf("ans= %d\n",ans);
    if (a>b)
    {
        c=a;
        a=b;
        b=c;
    }
    if ((h==60)&&(a!=60)&&(b!=60))
        h=0;
    if (((h<=a)||(h>=b))&&((m<a)||(m>b))&&((s<a)||(s>b)))
        ans=1;
    printf("ans= %d",ans);
    if ((ans==0)&&(((h>=a)&&(h<=b))&&((m>a)&&(m<b))&&((s>a)&&(s<b))))
        ans=1;
    printf("ans= %d",ans);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int h,m,s,a,b,ans,c;
    //printf("Dwse tis wres ta lepta ta deuterolepta kai tis 2 xronikes stigemes a kai b\n");
    scanf("%d %d %d %d %d",&h,&m,&s,&a,&b);
    ans=0;
    h=h*5;
    a=a*5;
    b=b*5;
    if (a>b)
    {
        c=a;
        a=b;
        b=c;
    }
    if ((h==60)&&(a!=60)&&(b!=60))
        h=0;
     printf("h= %f m= %f",h,m);
    printf("h= %f m= %f",h,m);
    if (((h<a)||(h>=b))&&((m<a)||(m>=b))&&((s<a)||(s>b)))
        ans=1;
    if ((ans==0)&&((h>=a)&&(h<b)&&(m>=a)&&(m<b)&&(s>a)&&(s<b)))
        ans=1;
    if (ans==0)
        printf("NO");
    else
        printf("YES");
    return 0;
}

#include <stdio.h>

int main(void)
{
	int h, m, s, t1, t2;
	double posh, posm, poss, post1, post2;
	scanf("%d %d %d %d %d", &h, &m, &s, &t1, &t2);
	h = h % 12;
	t1 = t1 % 12;
	t2 = t2 % 12;
	poss = (double)s;
	posm = 6 * m + (double)s / 10;
	posh = 30 * h + (double)(60 * m + s) / 120;
	post1 = 30 * t1;
	post2 = 30 * t2;
	if((post1 >= posh && post2 <=posh && post1 >=posm && post2 <= posm && post1 >= poss && post2 <=poss) || (post2 >= posh && post1 <= posh && post2 >= posm && post1 <= posm && post2 >= poss && post1 <= poss))
	{
		puts("YES");
	}
	else
	{
		puts("NO");
	}

	return 0;
}


#include <stdio.h>

int main()
{
    long long n,m,i=1,j,count=0;
    scanf("%I64d %I64d",&n,&m);

    while(i<=n){
        count+=(m+5-(5-(i%5)))/5;
        i++;
    }

    printf("%I64d",count);

    return 0;
}

#include <stdio.h>

int main()
{
    long long int n, m, max, min, ans=0;
    int i;
    scanf("%lld %lld",&n,&m);
    if(m>n) max=m, min=n;
    else max=n, min=m;
    for(i=1;i<=min;i++)
    {
        ans+=(max+(i%5))/5;
    }
    printf("%lld",ans);
    return 0;
}

#include <stdio.h>
int main()
{
    int n,m,i;
    long long  sum=0;
    scanf("%d%d",&n,&m);
    for(i=1;i<=n;i++)
        sum+=((m+i)/5-i/5);
    printf("%lld",sum);
    return 0;
}

#include<stdio.h>
int main(){
	int n,m,div,rem;
	scanf("%d %d",&n,&m);
	unsigned long long output=0;
	div=m/5;
	rem=m%5;
	output=((unsigned long long)n*div)+((n/5)*rem);

	if((n%5)&&(rem)){

		if((n%5)==1){
			if(rem==4){
				output++;
			}
		}
		else if((n%5)==2){
			if(rem==4){
				output+=2;
			}
			else if (rem==3){
				output+=1;
			}
		}
		else if((n%5)==3){
			if(rem==4){
				output+=3;
			}
			else if (rem==3){
				output+=2;
			}
			else if(rem==2){
				output+=1;
			}
		}
		else if((n%5)==4){
			if(rem==4){
				output+=4;
			}
			else if (rem==3){
				output+=3;
			}
			else if(rem==2){
				output+=2;
			}
			else if (rem==1){
				output++;
			}
		}
	}
	printf("%I64d\n",output);

}

#include<stdio.h>
main()
{
      long long int n,m,i=1,j,sum=0;
    scanf("%I64d %I64d",&n,&m);

   for(i=1;i<=n;i++)
   {
      sum+=(m+(i%5))/5;
   }
   printf("%I64d",sum);
}

#include<stdio.h>

int main()
{
long long int n,m;
scanf("%lld %lld",&n,&m);
long long int p=n/5,q=n%5;
long long int r=m/5,s=m%5;
long long int count=0;
count=p*5*r+q*r+s*p;
if(q+s>=5) {count+=(q+s)-4;}
printf("%lld",count);
return 0;
}

#include<stdio.h>
int main()
{
	int n,m,i,k;
	long long int sum=0;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)
	{
		sum=sum+(m+i%5)/5;
	}
	printf("%lld\n",sum);
	return 0;
}

/* 20160711 JJA Codeforces #358 A.Alyona and Numbers */

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main() {
	int n;
	int m;
	int tmp;
	unsigned long long counter = 0 ;
	scanf("%d %d", &n, &m);

	for (int i = 1; i <= n; i++) {
		counter += (i + m) / 5 - i / 5;
	}
	printf("%lld", counter);

}

#include<stdio.h>
int main()
{long long int n,m,i,j,sum=0;
scanf("%lld%lld",&n,&m);
for(i=1;i<=n;i++)
{sum=sum+((m+i)/5-i/5);}

printf("%lld",sum);
return 0;
}

/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>

int main()
{
    int n , m ,p , i;
    long long int sum = 0;
    scanf("%d %d",&n,&m);
    if (n > 4){
        for (i=0;i<5;i++){
            sum = sum + (i+m)/5;
        }
        sum = sum*(n/5);
        p = n%5;
        for (i=1;i<p+1;i++)
            sum = sum + (i+m)/5;
        printf("%lld",sum);
    }
    else{
        p = n%5;
        for (i=1;i<p+1;i++)
            sum = sum + (i+m)/5;
        printf("%lld",sum);
    }

}

#include<stdio.h>
int main()
{
    int i;
    long long int c,a,b,x,y;
    scanf("%lld%lld",&a,&b);
    int r1=a%5;
    int r2=b%5;
    c=(a/5)*(b/5);

    for(i=1;i<=4;i++)
    {
        x=a/5;
        y=b/5;
        if(r1>=i)
        {
            x=x+1;
        }
        if(r2>=(5-i))
        {
         y=y+1;
        }
        c=x*y + c;
    }

    printf("%lld\n",c);
    return 0;
}

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>

int main()
{
       long long int n,m,t,i,p=0;
      scanf(" %lld %lld",&n,&m);
      for(i=1;i<=n;i++){

                p+=(m+i)/5 - i/5;

      }
      printf("%lld",p);
    return 0;
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    //input
    unsigned long long int n, m;
    scanf("%lld %lld", &n, &m);
    unsigned long long int max, min;
    if(n > m)
    {
        max = n;
        min = m;
    }
    else
    {
        max = m;
        min = n;
    }

    unsigned long long int count = min * (max/5);

    for(int i = 1; i <= min; i++)
        for(int j = 1; j <= max%5; j++)
            if((i+j) % 5 == 0) count++;

    printf("%lld", count);

    return 0;
}

#include<stdio.h>
int main()
{
    long long int n,m,a,b,c,d,tot=0;
    scanf("%lld %lld",&n,&m);
    a=m/5;

    tot=a*n;

    c=m%5;

    d=n/5;

    tot=tot+c*d;

    b=m%5;
    c=n%5;
    d=b+c;
    d=d-4;
    if(d>0)
        tot=tot+d;

    printf("%lld\n",tot);

    return 0;
}

#include<stdio.h>
int main()
{
    long long int n,m,i,j,k,count,vag1,vag2,vag,t,temp,p;
    scanf("%I64d %I64d",&n,&m);
    count=0;
    if(n+m>=5){
        if(n>m){
            temp=n;
            n=m;
            m=temp;
        }
    for(i=1;i<=n;i++){
            k=1;
            t=k;
        while((i+k)%5!=0){

            k++;
            t=k;
        }
            p=(m-t+5)/5;
            count+=p;
         }
  printf("%I64d\n",count);
    }
    else
        printf("0\n",count);
  return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    long long int m,n,i,ans=0,temp;
    scanf("%lld %lld",&n,&m);

    for(i=1;i<=n;i++)
    {
        temp=i%5;
        long long int d=m-5+temp;
        if(d>=0)
        {
            ans++;
            ans=ans+d/5;
        }
    }
    printf("%lld\n",ans);
    return 0;
}

#include<stdio.h>
int main()
{
	long long int a,b,i,j,count=0,x,y,z;
	scanf("%lld%lld",&a,&b);
	for(i=1;i<=5;i++)
	{
		x=0;
		y=0;
		if(a>=i)
		{
			x=(a-i)/5+1;
		}
		z=(5-(i%5));
		if(b>=z)
		{
			y=(b-z)/5+1;
		}
		count=x*y + count;
	}

	printf("%lld\n",count);
	return 0;
}

#include <stdio.h>
#include <string.h>

int satarmatha(long long int n,long long int m,long long int x)
{
    long long int u = x - m - 1;
    if(u < 0){
        u = 0;
    }
    if(n - u >= 0 && n<x){
        return n - u;
    }
    else if(n>=x && m>=x){
        return x-1;
    }
}
int main()
{
    long long int x, a, n, k, m, i, l, sum=0, max, min, j=0;
    scanf("%I64d %I64d", &n, &m);
    x = (n + m) / 5;
    //printf("%d", 5*x);
    if(n > m){
        max = n;
        min = m;
    }
    else{
        max = m;
        min = n;
    }
    x *= 5;
    //printf("%d\n", x);
    for(i=0;;i++){
        if(x == 0) break;
        sum += satarmatha(min,max,x);
        x -= 5;

    }

    printf("%I64d", sum);
}

#include<stdio.h>
main()
{
	int n,m,i,d;
	long long s=0;
	scanf("%d %d",&n,&m);
	for(i=1;i<=n;i++)
	{
		d=(m+i)/5-i/5;
		s+=d;
	}
	printf("%I64d",s);
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
long long p[10],q[10];
int main()
{
	int n,x,y,l;
	long long ans=0,i,j,k,a,b;
	scanf("%I64d%I64d",&a,&b);
	for(i=1;i<=a;i++)
		p[i%5]++;
	for(i=1;i<=b;i++)
		q[i%5]++;
	ans+=p[1]*q[4];
	ans+=p[2]*q[3];
	ans+=p[3]*q[2];
	ans+=p[4]*q[1];
	ans+=p[0]*q[0];
 	printf("%I64d",ans);
return 0;
}

#include<stdio.h>
int main()
{
    long long int n,m,i,j,sum,a;
    while(scanf("%lld%lld",&n,&m)!=EOF)
    {
        sum=0;
        for(i=1;i<=n;i++)
        {
           a=i%5;
           sum=sum+(m+a)/5;
        }
        printf("%lld\n",sum);
    }
    return 0;
}

#include <stdio.h>

int min(int a,int b){

    if(a < b)
        return a;
    return b;
}
int main(){

    int n, m, v[10], i;
    long long answ = 0;
    scanf("%d %d",&n,&m);

    for(i = 0;i <= 4; ++i)
        v[i] = 0;

    for(i = 1;i <= n; ++i)
        ++v[i % 5];
    for(i = 1;i <= m; ++i)
        if(i % 5 > 0)
            answ = answ + v[5 - (i % 5)];
        else
            answ = answ + v[0];

    printf("%I64d",answ);
}

#include <stdio.h>

#define g(x, i) (x / 5 + (x % 5 >= (i)))

int main() {
    long long m, n, c = 0;
    int i;
    scanf("%I64d %I64d\n", &n, &m);
    for (i = 0; i < 5; ++i)
        c += g(n, i ? i : 5) * g(m, 5 - i);
    printf("%I64d", c);
}

#include<stdio.h>

int main(){
    long long n,m,i,x,y,c=0,z,j;
    scanf("%lld %lld",&n,&m);
    if(n>m){x=m;y=n;}
    else{x=n;y=m;}
    for(i=x;i>=1;i--){
            z=(i+y)/5-(i/5);
            c+=z;
    }
    printf("%lld\n",c);
}

#include<stdio.h>
#include<inttypes.h>
main()
{
    int64_t n, m, y=0, i;
    scanf("%I64d %I64d", &n, &m);
    for(i=1; i<=n; i++){
        y=y+(m+(i%5))/5;
    }
    printf("%I64d", y);
}

///Be Grateful For What You Have
///Never Give Up
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>

int main()
{
    long long i,n,m,p1,p2,ara1[6]={0},ara2[6]={0},sum=0;
    scanf("%lld %lld",&n,&m);
    p1=n/5;
    p2=m/5;
    n-=p1*5;
    m-=p2*5;
    for(i=0;i<5;i++){
        ara1[i]=p1;
        ara2[i]=p2;
        if(i==0)
            continue;
        if(i<=n){ara1[i]++;}
        if(i<=m){ara2[i]++;}
    }
    sum=ara1[0]*ara2[0]+ara1[1]*ara2[4]+ara1[2]*ara2[3]+ara1[3]*ara2[2]+ara1[4]*ara2[1];
    printf("%lld",sum);
    return 0;
}

#include<stdio.h>

int  main()
{

    long long int i,j,k,l;

    long long int n,m;
    scanf("%lld %lld",&n,&m);
    long long int t;

long long int count=0;
    for(i=1;i<=n;i++)
    {
        count=count + ((i+m)/5) - (i/5);
    }

printf("%lld",count);

return 0;
}

#include<stdio.h>
#include<math.h>
int main ()
{
    long long int a,b,n,m,i,j;
    scanf("%lld%lld",&n,&m);
    if(n<=m)
    {
        a=m;
        b=n;
    }
    else if(n>m)
    {
        a=n;
        b=m;
    }
    long long int count=0;
    for(i=1; i<=b; i++)
    {
        if((i%5)>=(5-a%5))
            count=count+(a/5)+1;
        else
            count=count+(a/5);

    }
    printf("%lld\n",count);
}

#include <stdio.h>

int main() {
	int n, m, x;
	long long cnt;

	scanf("%d%d", &n, &m);
	cnt = 0;
	for (x = 1; x <= n; x++) {
		int high, low;

		low = (5 - x % 5 - 1) % 5 + 1;
		high = m - m % 5 + (5 - x % 5) % 5;
		if (high > m)
			high -= 5;
		cnt += (long long) (high - low) / 5 + 1;
	}
	printf("%lld\n", cnt);
	return 0;
}

#include <stdio.h>

int c(int n, int k) {
	if (k == 0)
		return n / 5;
	else {
		n -= k;
		return n < 0 ? 0 : n / 5 + 1;
	}
}

int main() {
	int i, n, m;
	long long cnt;

	scanf("%d%d", &n, &m);
	cnt = 0;
	for (i = 0; i < 5; i++)
		cnt += (long long) c(n, i) * c(m, (5 - i) % 5); /*cnt * num*/
	printf("%lld\n", cnt);
	return 0;
}

#include<stdio.h>
  int main(void)
{

    long long n ,m,i,temp,r=0,j;
    scanf("%I64d %I64d",&n,&m);
    for(i=1;i<=n;i++)
    {
        temp=(i/5)+1;
        temp=(temp)*5-i;
        if(temp<=m)
        {
            r++;
        }
        j=m-temp;
        r=r+(j/5);
    }
    printf("%I64d",r);
}

#include<stdio.h>
#include<stdlib.h>
long long p[10],q[10];
void main()
{
long long n,m,i,s=0;
scanf("%lld %lld",&n,&m);

for(i=1;i<=n;i++)
p[i%5]++;

for(i=1;i<=m;i++)
q[i%5]++;

for(i=0;i<5;i++){
	if(i==0)
s=s+p[i]*q[i];
else
s=s+p[i]*q[5-i];}

printf("%lld\n",s);
exit(0);
}

#include<stdio.h>
int main()
{
    long long int n,m,i,a[6],b[6],ans=0;
    scanf("%lld%lld",&n,&m);
    for(i=1;i<=5;i++)
    {
        a[i]=(n+5-i)/5;
        b[i]=(m+5-i)/5;
    }
    for(i=1;i<5;i++)
        ans=ans+a[i]*b[5-i];
        ans=ans+a[i]*b[i];
        printf("%lld",ans);
        return 0;
}

#include <stdio.h>
int main(int argc, char const *argv[])
{
	long long int x, y,i;
	scanf("%I64d %I64d", &x, &y);
	long long int xl = x/5;
	long long int yl = y/5;
	long long int c = xl * yl * 5;
	long long int xm = x % 5;
	long long int ym = y % 5;
	c += xm * yl;
	c += ym * xl;
	for (i = xm; i > 0; --i)
	{
		if(ym >= 5-i) c++;
	}
	printf("%I64d\n", c);
	return 0;
}

#include <stdio.h>

int n,m;
long long ans=0;
long long h[10];
int main(){
    int i;
    scanf ("%d%d",&n,&m);
    for (i=1;i<=m;i++){
        if (i%5) h[i%5]++;
        else h[5]++;
    }
    for (i=1;i<=n;i++){
        ans += h[5-(i%5)];
    }
    printf ("%I64d\n",ans);
    return 0;
}

#include<stdio.h>
#include<math.h>

int main()
{
	long long int n,m,i,j,count=0;
	scanf("%lld%lld",&n,&m);
	count=(n/5)*(m/5)*5;
	for(i=0;i<=m%5;i++)
		for(j=0;j<=n%5;j++)
			if(i+j==5)
				count++;
	count+=(m%5)*(n/5);
	count+=(n%5)*(m/5);
	printf("%lld\n",count);
	return 0;
}

#include <stdio.h>

int main()
{
    long long int x, y, res, rem, div, div2, i, j, sum, count, ara[5];
    while(scanf("%lld%lld", &x, &y)==2)
    {
        count=0;
        if(x<5 || y<5){
            for(i=1; i<=x; i++)
            for(j=1; j<=y; j++)
        {
            sum=i+j;
            if(sum%5==0) count++;
        }
        printf("%d\n", count);
        }
        else{
            div=y/5;
            div2=x/5;
            rem=x%5;
            if(((div*5)+4)<=y)
            {
                ara[1]=div+1;
            }
            else ara[1]=div;

            if(((div*5)+3)<=y){
                ara[2]=div+1;
            }
            else ara[2]=div;

            if(((div*5)+2)<=y)
            {
                ara[3]=div+1;
            }
            else ara[3]=div;

        if(((div*5)+1)<=y)
            {
                ara[4]=div+1;
            }
            else ara[4]=div;
            if(((div*5)+5)<=y)
            {
                ara[5]=div+1;
            }
            else ara[5]=div;
            res=div2*(ara[1]+ara[2]+ara[3]+ara[4]+ara[5]);
            for(i=1; i<=rem; i++)
            {
                res+=ara[i];
            }
            printf("%lld\n", res);
        }
    }
    return 0;
}

#include<stdio.h>
int main ()
{
    long long int n,m,a,b,c,d,i,sum=0;
    scanf("%lld %lld",&n,&m);
    if(n+m<5)
    {
        printf("0\n");
        return 0;
    }
    if(n+m==5)
    {
        printf("1\n");
        return 0;
    }
    if(n+m>5)
    {
        if(n<=m)
        {
            for(i=1;i<=n;i++)
            {
                if(i==1 && m<4);
                else
                {
                    a=i%5;
                    b=5-a;
                    c=m-b;
                    d=c/5;
                    sum=sum+d+1;
                }
            }
        }
        else
        {
            for(i=1;i<=m;i++)
            {
                if(i==1 && n<4);
                else
                {
                    a=i%5;
                    b=5-a;
                    c=n-b;
                    d=c/5;
                    sum=sum+d+1;
                }
            }
        }
    }
    printf("%lld\n",sum);
    return 0;
}

#include<stdio.h>
int main()
{
int n,m,i,first;
long long int sum=0;
scanf("%d%d",&n,&m);
for(i=1;i<=n;i++)
{
first=5-(i%5);
if(m>=first)
	sum=sum+((m-first)/5) +1;
}
printf("%lld\n",sum);
return 0;
}

#include<stdio.h>
int main()
{
    long long int n , m , i , ans=0 ;

    scanf("%I64d%I64d",&n,&m);

    for(i=1 ; i<=n ; i++)
    {
        ans += (m+i)/5 - i/5 ;
    }

    printf("%I64d",ans);

    return 0 ;
}

#include <stdio.h>

int main()
{
    long long int n, m, q_n, mod_n, q_m, mod_m, total_pairs = 0, i, temp;

    scanf("%lld %lld", &n, &m);

    if(n > 1000000 || m > 1000000) return 1;

    if(n > m)
    {
        temp = m;
        m = n;
        n = temp;
    }

    q_m = m / 5;
    mod_m = m % 5;

    for(i = 1; i <= n; i++)
    {
        total_pairs += q_m;
        if((i % 5 + mod_m) >= 5) total_pairs++;
    }

    printf("%lld\n", total_pairs);

    return 0;
}

/*  AUTHOR:AKASH JAIN
*   USERNAME:akash19jain
*   DATE:09/07/2019
*/
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#define MOD 1000000007
int cmp(const void * a,const void * b);

int main()
{

    long long t=1;
    //scanf("%lld",&t);
    while(t--)
    {
        long long n,m,sum=0;
        scanf("%lld%lld",&n,&m);
        for(long long i=1;i<=n;i++)
        {
            sum+=(m+i%5)/5;
        }
        printf("%lld\n",sum);
    }
    return 0;
}

//qsort(a,n,sizeof(a[0]),cmp);
int cmp(const void * a,const void * b)
{
    return (*(int*)a - *(int*)b);
}

#include<stdio.h>

int A[6];

int main(void)
{
int m,n,min,max,count=0,i,val;

long long sum=0;

scanf("%d%d",&m,&n);

if(m<=n)
{
min=m;
max=n;
}
else
{
min=n;
max=m;
}

for(i=1; i<=min; i++)
{
 val=5-i%5;
if(val<=max)
{
count+=(max-val)/5;
A[i]=count+1;
count=0;
if(i==5)
break;
}
}

for(i=1; i<=5; i++)
sum+=A[i];

if(min>5)
{
sum*=min/5;
min%=5;
for(i=1; i<=min; i++)
sum+=A[i];
}

printf("%lld",sum);
return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
int main()
{
    long long a,b;
    long long c=0,n=1,t=5,temp;
    scanf("%lld%lld",&a,&b);
    long long minimum=(min(a,b)),maximum=(max(a,b));
    if((a==b&&a<3))
    printf("0");
    else if(a==b&&a==3)
    printf("2");
    else if(a==b&&a%10==0&&b%10==0)
    printf("%lld",a*(b/10)*2);
    else
    {
        while(n<=minimum)
        {
            temp=abs(n-t);
            if(n%5!=0&&(maximum-temp)>=0)
            {c+=((maximum-temp)/5)+1;
            //printf("%d %d\n",n,c);
            }
            else
            c+=((maximum-temp)/5);
            n++;
            if((n-t)>0)
            t+=5;
        }
        printf("%lld",c);
    }
    return 0;
}

#include<stdio.h>
int main(){
	long long i,n,m,count=0,min,max;
	scanf("%lld %lld",&n,&m);
	min=n;max=m;
	if(n>m){
		max=n;
		min=m;
	}
	for(i=1;i<=min;i++){
		count+=max/5;
		if((max%5)>=(5-(i%5)))
			count++;
	}
	printf("%lld\n",count);
	return 0;
}

#include <stdio.h>

unsigned long long count_pairs_multiple_5(unsigned long long, unsigned long long);
int main()
{
    unsigned long long m, n, answer;
    scanf("%I64u %I64u",&m, &n);
    answer = count_pairs_multiple_5(m,n);
    printf("%I64u\n",answer);
    return 0;
}

unsigned long long count_pairs_multiple_5(unsigned long long m, unsigned long long n)
{
    short i;
    unsigned long long answer = 0, current_mod_x, current_mod_y;

    answer = (n/5)*(m/5);//doing the case of i = 0 (mod 5) separately because (m - (5 - i)) will actually lose 1 possible value of y.
    for(i = 1; i <5; i++)
    {
        current_mod_x = n/5;
        current_mod_y = m/5;
        if(n%5 >= i)
        {
            current_mod_x++;
        }
        if(m%5 >= 5 - i)
        {
            current_mod_y++;
        }
        answer = answer + current_mod_x*current_mod_y;
    }
    return answer;
}

#include <stdio.h>
int main()
{
    int n, m, tmp;
    scanf("%d%d", &n, &m);
    long long int ans = 0;
    for(int i = 1; i <= n; i++)
    {
        tmp = m;
        ans += (tmp + (i%5)) / 5;
    }
    printf("%I64d\n", ans);
}

#include<stdio.h>
int main()
{
    int n,m;
    long long cnt=0;
    scanf("%d %d",&n,&m);
    int mx,lo;
    if(n>m)
    {
        mx=n;
        lo=m;
    }
    else
    {
        mx=m;
        lo=n;
    }
    for(int i=1;i<=lo;i++)
    {
        if(mx+lo<5)
        {
            break;
        }
        if(i<=mx && i+mx>=5)
        {
            cnt++;
            cnt+=(mx-(5-i%5))/5;
        }
    }
    printf("%lld\n",cnt);
    return 0;
}

#include <stdio.h>

int main(void)
{
	long long int v_M, v_N, v_CT = 0;

	scanf("%I64d %I64d", &v_M, &v_N);

	if(v_M > v_N)
	{
		v_M += v_N;
		v_N = v_M - v_N;
		v_M -= v_N;
	}

	if(v_M < 5 && v_N < 5)
	{
		for(long long int i = 1; i <= v_M; i++)
		{
			for(long long int j = 1; j <= v_N; j++)
			{
				if((i + j) == 5)
					v_CT++;
			}
		}
	}
	else
	{
		for(long long int i = 1; i <= v_M; i++)
		{
			if(i != 5)
				v_CT += (v_N - ((((i / 5) + 1) * 5) - i)) / 5 + 1;
			else
				v_CT += v_N / 5;
		}
	}

	printf("%I64d", v_CT);

	return(0);
}

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(void)
{
	long int n,m,i,a,j,b,c;
	double count;
	scanf("%ld%ld",&n,&m);
	count=0;
	for(i=1;i<=n;i++)
	{
	    a=i%5;
	    a=5-a;
	    b=m/5;
	    j=m-5*(b);
	    if(j>=a)
	    count=count+b+1;
	    else
	    count=count+b;

   }
	printf("%.0lf",count);

}

#include <stdio.h>

int main()
{
	unsigned long long a, b, c;
	int ZA[5];

	scanf("%llu%llu",&a, &b);
	if (a < b) {
		c = b;
		b = a;
		a = c;
	}
	for (c = 0; c < 5; ++c)
		ZA[c] = a / 5;
	for (c = 0; c <= a % 5; ++c)
		ZA[c] += 1;
	ZA[0] -= 1;
	c = 0;
	for (a = 1; a <= b; ++a)
		c += ZA[(5 - a % 5) % 5];
	printf("%llu\n", c);

	return 0;
}

#include<stdio.h>

int main()
{
    int n,i,m,j;
    long long int count=0;

    scanf("%d %d",&n,&m);

    if(n<=m)
    {
        //int temp;
        for(i=1;i<=5;i++)
        {
            for(j=0;j-i<=m;j+=5)
            {
                if( j>=i && j-i<=m && j-i>0) count++;
                //printf("i=%d j=%d count=%d (%d-%d)=%d couple(%d,%d)\n",i,j,count,j,i,j-i,i,j-i);
            }
            //printf("\n");
        }
        count=count*(n/5);
        //printf("count= %d nmod5= %d\n",count,n%5);
        for(i=1;i<=n%5;i++)
        {
            for(j=0;j-i<=m;j+=5)
            {
                if( j>=i && j-i<=m && j-i>0) count++;
                //printf("i=%d j=%d count=%d (%d-%d)=%d couple(%d,%d)\n",i,j,count,j,i,j-i,i,j-i);
            }
            //printf("\n");
        }
    }

    else
        {
            for(i=1;i<=5;i++)
        {
            for(j=0;j-i<=n;j+=5)
            {
                if( j>=i && j-i<=n && j-i>0) count++;
                //printf("i=%d j=%d count=%d (%d-%d)=%d couple(%d,%d)\n",i,j,count,j,i,j-i,i,j-i);
            }
            //printf("\n");
        }
        count=count*(m/5);
        //printf("count= %d nmod5= %d\n",count,n%5);
        for(i=1;i<=m%5;i++)
        {
            for(j=0;j-i<=n;j+=5)
            {
                if( j>=i && j-i<=n && j-i>0) count++;
                //printf("i=%d j=%d count=%d (%d-%d)=%d couple(%d,%d)\n",i,j,count,j,i,j-i,i,j-i);
            }
            //printf("\n");
        }
        }

    printf("%lld",count);

    return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
  long long int x,y,a=0;
  scanf("%lld%lld",&x,&y);
  for (int i=1;i<=x;i++)
    a+=(i+y)/5 - i/5;
printf("%lld",a);
    return 0;
}

#include<stdio.h>

int main()
{

    int x,y,i,j,k,l,sum;
    unsigned long long int c;

    scanf("%d %d",&x,&y);

    c = 0;

    i = 1;
    j = 1;

    for(i=1;i<=x;i++){
            for(j=1;j<=5;j++){
                    sum = i + j;
                    if(sum%5==0 && j<=y){
                        c = c + 1;
                        c = c + (y-j)/5;
                        break;
                    }

            }

    }

    printf("%I64d\n",c);

    return 0;

}

#include<stdio.h>
int main()
{
    long long int n,m,x,i,a,b,c,d,sum=0;
    scanf("%lld%lld",&m,&n);
    if(n>m){
        x=n;
        n=m;
        m=x;
    }
    for(i=m;i>=1;i--){
        a=i+n;
        b=a/5;
        c=i/5;
        d=b-c;
        sum=sum+d;
    }
    printf("%lld",sum);
    return 0;
}

#include<stdio.h>
int main(){
    long long int n,m,count=0,i,j;
    scanf("%lld %lld", &n,&m);
    int q1,rn,rm,q2;
    q1=n/5;
    q2=m/5;
    rn=n%5;
    rm=m%5;
    count=q2*n+q1*rm;
    if(rn==1){
        if(rm==4)   count++;
    }
    else if(rn==2){
        if(rm==3)   count++;
        else if(rm==4)  count=count+2;
    }
    else if(rn==3){
        if(rm==2)       count++;
        else if(rm==3)  count+=2;
        else if(rm==4)  count+=3;
    }
    else if(rn==4){
        if(rm==1)       count++;
        else if(rm==2)  count+=2;
        else if(rm==3)  count+=3;
        else if(rm==4)  count+=4;
    }

    /*for(i=1;i<=n;i+=5){
        for(j=4;j<=m;j+=5){
            count++;
        }
    }
    for(i=2;i<=n;i+=5){
        for(j=3;j<=m;j+=5){
            count++;
        }
    }
    for(i=3;i<=n;i+=5){
        for(j=2;j<=m;j+=5){
            count++;
        }
    }
    for(i=4;i<=n;i+=5){
        for(j=1;j<=m;j+=5){
            count++;
        }
    }
    for(i=5;i<=n;i+=5){
        for(j=5;j<=m;j+=5){
            count++;
        }
    }*/
    printf("%lld", count);
}

#include <stdio.h>

int main()
{
    long long int m=0,i,j,k,l;
    scanf("%lld %lld",&i,&j);
    for(k=1;k<=i;k++)
    {
        l=k%5;
        m=m+(j+l)/5;
    }
    printf("%lld",m);

    return 0;
}

#include <stdio.h>

int main()
{
    int n,m,count=0;
    int rem;
    scanf("%d %d",&n,&m);
    if(n>m)
    {
        int temp=m;
        m=n;
        n=temp;
    }
    for(int i=1;i<=m;i++)
    {
        rem=5*(i/5 + 1) -i;

        if(rem==5)
            rem=0;

        for(int j=5-rem;j<=n;j+=5)
        {
            count++;
        }
    }
    printf("%d",count);
}

#include<stdio.h>
int main(){
int n,m,x,y,i,j,p=0,d;
scanf("%d %d",&n,&m);
for(i=1;i<=n;i++){
        d=(m+i)/5-i/5;
            p=p+d;
    }
printf("%d",p);
return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
int main()
{
    long long a,b;
    long long c=0,n=1,t=5,temp;
    scanf("%lld%lld",&a,&b);
    long long minimum=(min(a,b)),maximum=(max(a,b));
    if((a==b&&a<3))
    printf("0");
    else if(a==b&&a==3)
    printf("2");
    else if(a==b&&a%10==0&&b%10==0)
    printf("%lld",a*(b/10)*2);
    else
    {
        while(n<=minimum)
        {
            temp=abs(n-t);
            if(n%5!=0&&(maximum-temp)>0)
            c+=((maximum-temp)/5)+1;
            else
            c+=((maximum-temp)/5);
            n++;
            if((n-t)>0)
            t+=5;
        }
        printf("%lld",c);
    }
    return 0;
}

#include <stdio.h>

int main(void)
{
	long long int v_M, v_N, v_CT = 0;

	scanf("%I64d %I64d", &v_M, &v_N);

	for(long long int i = 1; i <= v_M; i++)
	{
		if(i != 5)
			v_CT += (v_N - ((((i / 5) + 1) * 5) - i)) / 5 + 1;
		else
			v_CT += v_N / 5;
	}

	printf("%I64d", v_CT);

	return(0);
}

#include<stdio.h>
int main()
{
    int n,m;
    long long cnt=0;
    scanf("%d %d",&n,&m);
    int mx,lo;
    if(n>m)
    {
        mx=n;
        lo=m;
    }
    else
    {
        mx=m;
        lo=n;
    }
    for(int i=1;i<=lo;i++)
    {
        if(i<=mx)
        {
            cnt++;
            cnt+=(mx-(5-i%5))/5;
        }
    }
    printf("%lld\n",cnt);
    return 0;
}

#ifdef ONLINE_JUDGE
    #define NDEBUG 1
#endif
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include <math.h>

#define long int64_t
#define fore(i,k,n) for (int _k = (k), _n = (n), i = _k; i <= _n; ++i)
#define forr(i,n,k) for (int _k = (k), _n = (n), i = _n; i >= _k; --i)
#define scani(x) int x; scanf("%d", &x)
#define scans(x) static char x[LEN]; scanf("%s", x)
#define LIST_INIT_CAP 4
#define HASH_INIT_CAP 64
#define HASH_SKIP 11
#define TREE_INIT_CAP 1024
#define TREE_MAX_HEIGHT 64
#define DEQUE_INIT_CAP 1024
#define HEAP_INIT_CAP 1024
#define TAKEN 1
#define EMPTY 0
#define TOMB -1
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))

#define N 100004

int main() {
    scani(n);
    scani(m);
    if (n > m) { int t = n; n = m; m = t; }
    long answer = 0;
    fore (i, 1, n) {
        int t = 5 - i % 5;
        if (t == 0) t = 5;
        if (m > t) {
            ++answer;
            answer += (long)(m - t) / 5;
        }
    }
    printf("%I64d", answer);

    return 0;
}

#include<stdio.h>
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
int main()
{
    long a,b;
    long c=0,n=1,t=5,temp;
    scanf("%ld%ld",&a,&b);
    long minimum=(min(a,b)),maximum=(max(a,b));
    while(n<=minimum)
    {
        temp=abs(n-t);
        if(n%5!=0)
        c+=((maximum-temp)/5)+1;
        else
        c+=((maximum-temp)/5);
        n++;
        if((n-t)>0)
        t+=5;
    }
    printf("%ld",c);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
   long m, n;
   scanf("%d %d", &m, &n);

   long m_div = m / 5;
   long n_div = n / 5;
   long m_rem = m % 5;
   long n_rem = n % 5;

   long count = m_div * n_div;

   for(int i = 1 ; i < 5 ; i++)
   {
      int j = 5 - i;

      long m_tmp = m_div;
      long n_tmp = n_div;

      if(i <= m_rem)
      {
         m_tmp++;
      }

      if(j <= n_rem)
      {
         n_tmp++;
      }

      count += m_tmp * n_tmp;
   }

   printf("%d\n", count);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    unsigned long m,n,k;
    unsigned long a=0,b=0,c=0,d=0,e=0;
    unsigned long a1=0, b1=0, c1=0, d1=0, e1=0;
    scanf("%d%d", &m,&n);

    if(m>n){
        k=m;
        m=n;
        n=k;
    }

    for(unsigned long i=1;i<=m;i++){
        if(i%5==1){
          a++;
        }else if(i%5==2){
          b++;
        }else if(i%5==3){
          c++;
        }else if(i%5==4){
          d++;
        }else{
          e++;
        }

    }

    for(unsigned long i=1;i<=n;i++){
        if(i%5==1){
          d1++;
        }else if(i%5==2){
          c1++;
        }else if(i%5==3){
          b1++;
        }else if(i%5==4){
          a1++;
        }else{
        e1++;
        }
    }

    printf("%lu", (unsigned long)(a*a1 + b*b1 + c*c1 + d*d1 + e*e1));
    return 0;
}

#include<stdio.h>
int main()
{
    long long int n,m,i,j,k,count,vag1,vag2,vag,t;
    scanf("%I64d %I64d",&n,&m);
    count=0;
    if(n+m>=5){
    for(i=1;i<=n;i++){
            k=1;
            t=k;
        while((i+k)%5!=0){

            k++;
            t=k;
        }
            vag=(m-t)/5 + 1;
            count+=vag;

   }
  printf("%I64d\n",count);
    }
    else
        printf("0\n",count);
  return 0;
}

#include<stdio.h>
int main()
{
    int m,n,i,j,k;

    scanf("%d %d",&n,&m);
    long long int ctr=0;

    for(int i=1;i<=n;i++)
    {
        ctr=ctr+(long long int)((m-5+i%5)/5);
    }

    printf("%lld\n",ctr+n);

    return 0;
}

#include<stdio.h>
int main()
{
    int n,m,i;

    int sum=0;
    scanf("%d%d",&n,&m);
    for(i=1;i<=m;i++)
    {
        sum=sum+(((i+n)/5)-(i/5));
    }
    printf("%d",sum);
    return 0;
}

#include <stdio.h>

int main()
{
    long long int n, m;
    long long int result;
    scanf("%lld %lld",&n,&m);
    double temp = n*m;
    result = (int)((temp/5)+.5);
    printf("%lld",result);
    return 0;
}

#include <stdio.h>

int main ()
{
    int n , m , i;
    int cnt =0;
    scanf("%d%d",&n,&m);
    for (i=1;i<=n;i++)
    {
         cnt+=(i+m)/5-i/5;

    }
    printf("%d\n",cnt);
      return 0 ;
}

#include <stdio.h>

int main()
 {
    int n,m,d=0,i;
    scanf("%d %d",&n,&m);
    for(i=1;i<=n;i++)
    {
   d+=(m+i%5)/5;
    }
    printf("%d",d);
 }

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
long long p[10],q[10];
int main()
{
	int n,x,y,l;
	long long ans=0,i,j,k,a,b;
	scanf("%I64d%I64d",&a,&b);
	for(i=1;i<=a;i++)
		p[i%5]++;
	for(i=1;i<=b;i++)
		q[i%5]++;
	ans+=p[1]*q[4];
	ans+=p[2]*q[3];
	ans+=p[3]*q[2];
	ans+=p[4]*q[1];
	ans+=p[0]*q[01];
 	printf("%I64d",ans);
return 0;
}

#include<stdio.h>
#include<inttypes.h>
int main()
{
    int64_t n,m,y=0;
    scanf("%I64d%I64d",&n,&m);
    y=(n*m)/5;
    if(n%2&&n!=1&&n%5&&m%2==0)
    y=y+1;
    printf("%I64d",y);
    return 0;
}

#include<stdio.h>
int main(){
	long i,n,m,count=0,min,max;
	scanf("%ld %ld",&n,&m);
	min=n;max=m;
	if(n>m){
		max=n;
		min=m;
	}
	for(i=1;i<=min;i++){
		count+=max/5;
		if((max%5)>=5-(i%5))
			count++;
	}
	printf("%ld\n",count);
	return 0;
}

#include <stdio.h>

int main()
{
    int n,m;
    long long int count=0;
    int rem,mrem;
    scanf("%d %d",&n,&m);
    if(n>m)
    {
        int temp=m;
        m=n;
        n=temp;
    }
    mrem=m%5;
    for(int i=1;i<=n;i++)
    {
        rem=i%5;
        if(mrem>=5-rem)
        {
            count+=(m-mrem)/5 + 1;

        }
        else
        {
            count+=(m-mrem)/5;

        }
    }

    printf("%ll",count);
}

#include<stdio.h>
#include<math.h>
int main()
{
    long long a,b;
    scanf("%lld%lld",&a,&b);
    if(a==b&&a%10==0)
        printf("%lld",a*((b*2)/10));
    else if((a*b)>100000&&a!=1&&b!=1)
    printf("%lld",(long long)round((a*b)/5.0)+1);
    else
    printf("%lld",(long long)round((a*b)/5.0));
}

#include <stdio.h>
void ans(int a,int b)
{
    int a1=a%5;
    int a2=b%5;

    int sum=0;
    if(a1+a2>=5)
    sum+=a1+a2-4;

    sum+=5*(a/5)*(b/5)+a1*(b/5)+a2*(a/5);
    printf("%d\n" , sum);

}

int main()
{
    int a,b;
    scanf("%d%d", &a, &b);
    ans(a,b);
}

#include<stdio.h>
#include<math.h>
int main()
{
    int i,j,n,m,k=0,a=0,b,c;
    scanf("%d %d",&n,&m);
    for(i=1;i<=n;i++){
            a=0;
            a=m+i;
            k=k+(a/5);
            if(i>=5){
                c=i/5;
                k=k-c;
            }
    }
     printf("%d\n",k);

    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    long long a,b;
    scanf("%lld%lld",&a,&b);
    if(a==b&&a%10==0)
        printf("%lld",a*((b*2)/10));
    else if((a*b)>100000)
    printf("%lld",(long long)round((a*b)/5.0)+1);
    else
    printf("%lld",(long long)round((a*b)/5.0));
}

#include <stdio.h>
#include <conio.h>

int main()
{
	long x,y;
	scanf("%ld %ld",&x,&y);
	long i,j;
	long long count = 0;

	i = x/5;
	j = y/5;
	count = i*j*5;
	int m,n;
	m=x%5;
	n=y%5;
	count = count + m*j + n * i;
	if ((n+m)==5) count++;
	else if ((n+m)==6) count = count + 2;
	else if ((n+m)==7) count = count +3;
	else if ((n+m)==8) count = count + 4;
	printf("%I64d",count);
	return 0;
}

#include <stdio.h>
int main(int argc, char const *argv[])
{
	int x, y,i;
	scanf("%d %d", &x, &y);
	int xl = x/5;
	int yl = y/5;
	int c = xl * yl * 5;
	int xm = x % 5;
	int ym = y % 5;
	c += xm * yl;
	c += ym * xl;
	for (i = xm; i > 0; --i)
	{
		if(ym >= 5-i) c++;
	}
	printf("%d\n", c);
	return 0;
}

#include <stdio.h>
int main(int argc, char const *argv[])
{
	int x, y,i;
	scanf("%d %d", &x, &y);
	int xl = x/5;
	int yl = y/5;
	int c = xl * yl * 5;
	int xm = x % 5;
	int ym = y % 5;
	c += xm * yl;
	c += ym * xl;
	for (i = xm; i > 0; --i)
	{
		if(ym >= 5-xm) c++;
	}
	printf("%d\n", c);
	return 0;
}

#include<stdio.h>
int main() {
	long m, n, i, temp;
	long count = 0;

	scanf("%d %d", &n, &m);
	for (i = 1; i <= n; i++) {
		temp = (m + i % 5) / 5;
		count += temp;
	}
	printf("%d", count);

	return 0;
}

#include<stdio.h>
#include<math.h>

int main()
{
	long int n,m,i,j,count=0;
	scanf("%ld%ld",&n,&m);
	count=(n/5)*(m/5)*5;
	for(i=0;i<=m%5;i++)
		for(j=0;j<=n%5;j++)
			if(i+j==5)
				count++;
	count+=(m%5)*(n/5);
	count+=(n%5)*(m/5);
	printf("%ld\n",count);
	return 0;
}

#include<stdio.h>
int main(){
	int n,m,div,rem,output;
	scanf("%d %d",&n,&m);
	div=m/5;
	rem=m%5;
	output=n*(div)+((n/5)*rem);
	if((n%5)&&rem){

		if((n%5)==1){
			if(rem==4){
				output++;
			}
		}
		if((n%5)==2){
			if(rem==4){
				output+=2;
			}
			else if (rem==3){
				output+=1;
			}
		}
		if((n%5)==3){
			if(rem==4){
				output+=3;
			}
			else if (rem==3){
				output+=2;
			}
			else if(rem==2){
				output+=1;
			}
		}
		if((n%5)==4){
			if(rem==4){
				output+=4;
			}
			else if (rem==3){
				output+=3;
			}
			else if(rem==2){
				output+=2;
			}
			else if (rem==1){
				output++;
			}
		}
	}
	printf("%d",output);

}

#include<stdio.h>
int main()
{
long int n,m,i,j,t;
long long int c=0;
scanf("%li%li",&n,&m);
for(i=1;i<=n;i++)
{
for(j=1;(i+j)%5!=0 && j<=m;j++)
;
if(j<=m)
{
t=(m-j)/5;
c+=t+1;
}
else
c=0;
}
printf("%I64d",c);
}

#include <stdio.h>
#include <stdlib.h>

int main()
{
    //input
    unsigned long int n, m;
    scanf("%ld %ld", &n, &m);
    long int max, min;
    if(n > m)
    {
        max = n;
        min = m;
    }
    else
    {
        max = m;
        min = n;
    }

    long int count = min * (max/5);

    for(int i = 1; i <= min; i++)
        for(int j = 1; j <= max%5; j++)
            if((i+j) % 5 == 0) count++;

    printf("%d", count);

    return 0;
}

#include <stdio.h>
int main()
{
	int n,m,t,i,j;
	scanf("%d %d",&n,&m);
	for(i=1;i<=n;i++){
		for(j=1;j<=m;j++){
			if((i+j)%5==0)
				t++;
		}
	}
	printf("%d",t);
	return 0;
}

#include <stdio.h>

int main()
{
    long long int n, m, i, num = 0, t;

    scanf("%lld%lld", &n, &m);

    for(i = 0;i < 5;i++)
    {
        if(i == 0)
        {
            t = (n / 5) * (m / 5);
        }
        else
        {
            t = ((n - i) / 5 + 1) * ((m + i - 5) / 5 + 1);
        }

        num += t;
    }

    printf("%lld", num);

    return 0;
}

#include <stdio.h>

int main()
{
    long long int n, m;
    long long int result;
    scanf("%lld %lld",&n,&m);
    double temp = n*m;
    if(m*n==m || m*n==n) result = ((m*n)+1)/5;
    else result = (int)((temp/5)+.5);
    printf("%lld",result);
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    long a,b;
    int c=0,n=1,t=5,k=t,temp;
    scanf("%ld%ld",&a,&b);
    if(a==b&&a%10==0)
    {printf("%ld",a*((b*2)/10));exit(0);}
    while(n<=a)
    {
        temp=abs(n-k);
        if(temp<=b)
        {
            if(temp>0)
                c++;
             k+=5;
            continue;
        }
        n++;
        if((n-t)>0)
        t+=5;
        k=t;
    }
    printf("%d",c);
}

#include<stdio.h>

int main()
{
int n,m;
scanf("%d %d",&n,&m);
int p=n/5,q=n%5;
int r=m/5,s=m%5;
int count=0;
count=p*5*r+q*r+s*p;
if(q+s>=5) {count+=(q+s)-4;}
printf("%d",count);
return 0;
}

#include<stdio.h>
int main()
{
int n,m,i;
long long int num_sol;
int rem_n[5];
int rem_m[5];
num_sol=0;
scanf("%d%d",&n,&m);
rem_m[0]=m/5-1;
rem_n[0]=n/5-1;
for(i=1;i<5;i++)
{rem_m[i]=m/5;
rem_n[i]=n/5;}
for(i=0;i<=m%5;i++)
rem_m[i]+=1;
for(i=0;i<=n%5;i++)
rem_n[i]+=1;
for(i=0;i<5;i++)
num_sol+=rem_m[i]*rem_n[(5-i)%5];
printf("%lld",num_sol);

return 0;}

#include <stdio.h>
#include <conio.h>

int main()
{
	int x,y;
	scanf("%i %i",&x,&y);
	int i,j;
	int count = 0;
	if (x<5||y<5)
	{
		for (i=1;i<=x;i++)
		{
			for(j=1;j<=y;j++)
			{
				if ((i+j)%5==0) count++;

			}
		}
		printf("%d",count);
		return 0;
	}
	i = x/5;
	j = y/5;
	count = i*j*5;
	int m,n;
	m=x%5;
	n=y%5;
	count = count + m*j + n * i;
	if ((n+m)>=5) count++;
	printf("%d",count);
	return 0;
}

#include<stdio.h>

int main()
{
    int n, m, c=0, max, min, i,  j, t, r, p;

    scanf("%d%d", &n, &m);
    if(n>m)
    {
        max=n;
        min=m;
    }
    else
    {
        max=m;
        min=n;
    }
    if(max%5==0)
        t=max/5;
    else
        t=(max/5)+1;
    for(i=1;i<=min;i++)
    {
        r=max+i;
        j=i/5;
        p=r/5;
        p-=j;
        if(p>t)
            c+=t;
        else
            c+=p;

    }
    printf("%d\n", c);
    return 0;
}

#include <stdio.h>

int main()
{
    int n,m,count=0;
    int rem;
    scanf("%d %d",&n,&m);
    if(n>m)
    {
        int temp=m;
        m=n;
        n=temp;
    }
    for(int i=1;i<=m;i++)
    {
        rem=5*(i/5 + 1) -i;

        if(rem==5)
            rem=0;

        for(int j=5-rem;j<=n;j+=5)
        {
            count++;
        }
    }
    printf("%d",count);
}

#include <stdio.h>

int solve(int n, int m)
{
	int r = 0;
	for(int i = 1; i <= n; ++i)
	{
		for(int j = 1; j <= 5 && j <= m; ++j)
		{
			if((i + j) % 5 == 0)
			{
				r += ((m - j) / 5) + 1;
				break;
			}
		}
	}
	return r;
}

int main()
{
	int n, m;
	scanf("%d %d", &n, &m);

	int r = solve(n, m);
	printf("%d\n", r);

	return 0;
}

#include <stdio.h>

#define __max(a, b) (((a) > (b)) ? (a) : (b))
#define __min(a, b) (((a) < (b)) ? (a) : (b))

int main()
{
	int n, x;
	scanf("%d\n%d\n", &n, &x);

	int temp1, temp2, flag = 0;

	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d\n", &temp1, &temp2);
		if (temp1 == x || temp1 == 7 - x)
		{
			flag = 1;
		}
		if (temp2 == x || temp2 == 7 - x)
		{
			flag = 1;
		}
	}
	if (flag == 0)
	{
		puts("YES");
	}
	else
	{
		puts("NO");
	}

	return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    long a,b;
    scanf("%ld%ld",&a,&b);
    printf("%.0f",round((a*b)/5.0));
}

#include<stdio.h>
int main()
{
    int n,m;
    long long cnt=0;
    scanf("%d %d",&n,&m);
    int mx,lo;
    if(n>m)
    {
        mx=n;
        lo=m;
    }
    else
    {
        mx=m;
        lo=n;
    }
    for(int i=1;i<=lo;i++)
    {
        if(mx+lo<5)
        {
            break;
        }
        if(i<=mx)
        {
            cnt++;
            cnt+=(mx-(5-i%5))/5;
        }
    }
    printf("%lld\n",cnt);
    return 0;
}

#include<stdio.h>
int main()
{
long int n,m,i,j,t;
long long int c=0;
scanf("%li%li",&n,&m);
for(i=1;i<=n;i++)
{
for(j=1;(i+j)%5!=0;j++)
;
t=(m-j)/5;
c+=t+1;
}
printf("%I64d",c);
}

#include<stdio.h>
#include<math.h>
int finrange(int n){
	int i;
	if((n+5)%5==0)
		return 5;
	if((n+1)%5==0)
		return 1;
	if((n+2)%5==0)
		return 2;
	if((n+3)%5==0)
		return 3;
	if((n+4)%5==0)
		return 4;
	return 0;
}
int main(){
	int c,n,m,i=1,ans=0,diff;
	scanf("%d%d",&n,&m);
	while(i<=n){
		//finrange(i);
		diff=finrange(i);
		ans+=(m-diff)/5;
		ans++;
		//printf("Ans : %d Diff : %d\n",ans,diff);
		i++;
	}
	printf("%d\n",ans);
}

#include<stdio.h>
int main()
{
    long int i,j,k,n,m;
    long long s;
    while(scanf("%ld %ld",&n,&m)!=EOF)
    {
        s=0;
        for(i=1;i<=n;i++)
        {
            k=1;
            j=(5-i%5)%5;
            if(j==0)
                k=0;
            s+=(m-j)/5+k;
        }
        printf("%I64d\n",s);
    }
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    long long int m,n;
    int arr[6]={0,0,0,0,0};
    scanf("%lld %lld",&n,&m);
    long long int i,j,x,y,temp,p;
    long long int ans=0;
    if (n<m)
    {
        x=n;
        n=m;
        m=x;
    }
    for(i=1;i<=m;i++)
    {
        p=i%5;
        arr[p]++;
    }
    for(i=0;i<n;i++)
    {
        x=i+1;
        temp=x%5;
        temp=5-temp;
        //printf("looking for temp== %d \n",temp);
        if(temp==5) temp--;
        ans=ans+arr[temp];
        // printf("x=%d\n",x);
      // printf("added temp= %d\n",arr[temp]);
      // printf("i=%d\n",i);
    }
    printf("%lld\n",ans);
    return 0;
}

#include <stdio.h>

int main()
{
    int n,m,count=0;
    int rem;
    scanf("%d %d",&n,&m);
    if(n>m)
    {
        int temp=m;
        m=n;
        n=temp;
    }
    for(int i=1;i<=n;i++)
    {
        rem=5*(i%5 + 1) -i;

        if(rem==5)
            rem=0;

        for(int j=5-rem;j<m;j+=5)
        {
            count++;
        }
    }
    printf("%d",count);
}

#include <stdio.h>

int min(int a,int b){

    if(a < b)
        return a;
    return b;
}
int main(){

    int n, m, v[10], i, answ = 0;
    scanf("%d %d",&n,&m);

    for(i = 0;i <= 4; ++i)
        v[i] = 0;

    for(i = 1;i <= n; ++i)
        ++v[i % 5];
    for(i = 1;i <= m; ++i)
        if(i % 5 > 0)
            answ = answ + v[5 - (i % 5)];
        else
            answ = answ + v[0];

    printf("%d",answ);
}

#include<stdio.h>
int main(){
	int c,n,m,i=1,ans=0,diff;
	scanf("%d%d",&n,&m);
	while(i<=n){
		ans+=(m+(i%5))/5;
		i++;
	}
	printf("%d\n",ans);
}

#include <stdio.h>

int main()
{
	int n,m,countA_0=0,countA_1=0,countA_2=0,countA_3=0,countA_4=0,countB_0=0,countB_1=0,countB_2=0,countB_3=0,countB_4=0,i,ans=0;
    scanf("%d",&n);
    scanf("%d",&m);

    for(i=1;i<=n;i++)
    {
        if((i%5)==0)
            countA_0++;
        else if((i%5)==1)
            countA_1++;
        else if((i%5)==2)
            countA_2++;
        else if((i%5)==3)
            countA_3++;
        else if((i%5)==4)
            countA_4++;
    }

    for(i=1;i<=m;i++)
    {
        if((i%5)==0)
            countB_0++;
        else if((i%5)==1)
            countB_1++;
        else if((i%5)==2)
            countB_2++;
        else if((i%5)==3)
            countB_3++;
        else if((i%5)==4)
            countB_4++;
    }

    ans=ans+(countB_0*countA_0)+(countB_1*countA_4)+(countB_2*countA_3)+(countB_3*countA_2)+(countB_4*countA_1);

    printf("%d",ans);
}

#include<stdio.h>
int main()
{
    int m,n,i,j,k;

    scanf("%d %d",&n,&m);
    long long int ctr=0;

    for(int i=1;i<=n;i++)
    {
        ctr=ctr+(long long int)((m-5+i%5)/5);
    }

    printf("%lld\n",ctr+n);

    return 0;
}

#include<stdio.h>
#include<math.h>
int main()
{
    long long a,b;
    scanf("%lld%lld",&a,&b);
    if(a==b&&a%10==0)
        printf("%lld",a*((b*2)/10));
    else
    printf("%lld",(long long)round((a*b)/5.0));
}