import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
	 	Scanner scanner = new Scanner(System.in);
	 	long N = scanner.nextLong();
	 	long x = 0;
	 	long y = 0;
	 	long sum = 0;
	 	x = N / 15;
	 	y = N % 15;
	 	sum = (60 + 60 + 120 * (x - 1)) * x / 2;
	 	if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	}
	 	//System.out.println(x);
	 	//System.out.println(y);
	 	System.out.println(sum);
 	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
	 	Scanner scanner = new Scanner(System.in);
	 	long N = scanner.nextLong();
	 	long x = 0;
	 	long y = 0;
	 	long sum = 0;
	 	x = N / 15;
	 	y = N % 15;
	 	sum = (60 + 60 + 120 * (x - 1)) * x / 2;
	 	if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	}
	 	//System.out.println(x);
	 	//System.out.println(y);
	 	System.out.println(sum);
 	}
} Main public static void main(String[] args) {
	 	Scanner scanner = new Scanner(System.in);
	 	long N = scanner.nextLong();
	 	long x = 0;
	 	long y = 0;
	 	long sum = 0;
	 	x = N / 15;
	 	y = N % 15;
	 	sum = (60 + 60 + 120 * (x - 1)) * x / 2;
	 	if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	}
	 	//System.out.println(x);
	 	//System.out.println(y);
	 	System.out.println(sum);
 	} main {
	 	Scanner scanner = new Scanner(System.in);
	 	long N = scanner.nextLong();
	 	long x = 0;
	 	long y = 0;
	 	long sum = 0;
	 	x = N / 15;
	 	y = N % 15;
	 	sum = (60 + 60 + 120 * (x - 1)) * x / 2;
	 	if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	}
	 	//System.out.println(x);
	 	//System.out.println(y);
	 	System.out.println(sum);
 	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long N = scanner.nextLong(); N scanner.nextLong() scanner.nextLong scanner long x = 0; x 0 long y = 0; y 0 long sum = 0; sum 0 x = N / 15 x N / 15 N 15 y = N % 15 y N % 15 N 15 sum = (60 + 60 + 120 * (x - 1)) * x / 2 sum (60 + 60 + 120 * (x - 1)) * x / 2 (60 + 60 + 120 * (x - 1)) * x (60 + 60 + 120 * (x - 1)) 60 + 60 + 120 * (x - 1) 60 60 120 * (x - 1) 120 (x - 1) x 1 x 2 if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 1 y 1 {
	 		sum += 1 + 15 * x;
	 	} sum += 1 + 15 * x sum 1 + 15 * x 1 15 * x 15 x if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 2 || y == 3 y == 2 y 2 y == 3 y 3 {
	 		sum += 3 + 15 * x * 2;
	 	} sum += 3 + 15 * x * 2 sum 3 + 15 * x * 2 3 15 * x * 2 15 * x * 2 15 x 2 if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 4 || y == 5 || y == 6 y == 4 || y == 5 || y == 6 y == 4 y 4 y == 5 y 5 y == 6 y 6 {
	 		sum += 7 + 15 * x * 3;
	 	} sum += 7 + 15 * x * 3 sum 7 + 15 * x * 3 7 15 * x * 3 15 * x * 3 15 x 3 if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 7 y 7 {
	 		sum += 14 + 15 * x * 4;
	 	} sum += 14 + 15 * x * 4 sum 14 + 15 * x * 4 14 15 * x * 4 15 * x * 4 15 x 4 if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 8 || y == 9 || y == 10 y == 8 || y == 9 || y == 10 y == 8 y 8 y == 9 y 9 y == 10 y 10 {
	 		sum += 22 + 15 * x * 5;
	 	} sum += 22 + 15 * x * 5 sum 22 + 15 * x * 5 22 15 * x * 5 15 * x * 5 15 x 5 if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 11 || y == 12 y == 11 y 11 y == 12 y 12 {
	 		sum += 33 + 15 * x * 6;
	 	} sum += 33 + 15 * x * 6 sum 33 + 15 * x * 6 33 15 * x * 6 15 * x * 6 15 x 6 if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 13 y 13 {
	 		sum += 46 + 15 * x * 7;
	 	} sum += 46 + 15 * x * 7 sum 46 + 15 * x * 7 46 15 * x * 7 15 * x * 7 15 x 7 if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	} y == 14 y 14 {
	 		sum += 60 + 15 * x * 8;
	 	} sum += 60 + 15 * x * 8 sum 60 + 15 * x * 8 60 15 * x * 8 15 * x * 8 15 x 8 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
	 	Scanner scanner = new Scanner(System.in);
	 	long N = scanner.nextLong();
	 	long x = 0;
	 	long y = 0;
	 	long sum = 0;
	 	x = N / 15;
	 	y = N % 15;
	 	sum = (60 + 60 + 120 * (x - 1)) * x / 2;
	 	if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	}
	 	//System.out.println(x);
	 	//System.out.println(y);
	 	System.out.println(sum);
 	}
} public class Main {
	public static void main(String[] args) {
	 	Scanner scanner = new Scanner(System.in);
	 	long N = scanner.nextLong();
	 	long x = 0;
	 	long y = 0;
	 	long sum = 0;
	 	x = N / 15;
	 	y = N % 15;
	 	sum = (60 + 60 + 120 * (x - 1)) * x / 2;
	 	if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	}
	 	//System.out.println(x);
	 	//System.out.println(y);
	 	System.out.println(sum);
 	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
	 	Scanner scanner = new Scanner(System.in);
	 	long N = scanner.nextLong();
	 	long x = 0;
	 	long y = 0;
	 	long sum = 0;
	 	x = N / 15;
	 	y = N % 15;
	 	sum = (60 + 60 + 120 * (x - 1)) * x / 2;
	 	if (y == 1) {
	 		sum += 1 + 15 * x;
	 	} else if (y == 2 || y == 3) {
	 		sum += 3 + 15 * x * 2;
	 	} else if (y == 4 || y == 5 || y == 6) {
	 		sum += 7 + 15 * x * 3;
	 	} else if (y == 7) {
	 		sum += 14 + 15 * x * 4;
	 	} else if (y == 8 || y == 9 || y == 10) {
	 		sum += 22 + 15 * x * 5;
	 	} else if (y == 11 || y == 12) {
	 		sum += 33 + 15 * x * 6;
	 	} else if (y == 13) {
	 		sum += 46 + 15 * x * 7;
	 	} else if (y == 14) {
	 		sum += 60 + 15 * x * 8;
	 	}
	 	//System.out.println(x);
	 	//System.out.println(y);
	 	System.out.println(sum);
 	}
}
