#include <stdio.h>
#include <stdlib.h>
 
int main(void){
    int i;
    long int j;
    j = 0;
    scanf("%d", &i);
    for(int x=0 ;x<(i+1)/15;x++){
    j += x*8*15 + 60;    
    }
    
    switch(i%15){
    case 0:
    j += 60 + ((i-2)/15)*15*8;;
    break;
    case 1:
    j += 1 + (i/15)*15;
    break;
    case 2:
    j += 3 + (i/15)*15*2;
    break;
    case 3:
    j += 3 + (i/15)*15*2;
    break;
    case 4:
    j += 7 + (i/15)*15*3;
    break;
    case 5:
    j += 7 + (i/15)*15*3;
    break;
    case 6:
    j += 7 + (i/15)*15*3;
    break;
    case 7:
    j += 14 + (i/15)*15*4;
    break;
    case 8:
    j += 22 + (i/15)*15*5;
    break;
    case 9:
    j += 22 + (i/15)*15*5;
    break;
    case 10:
    j += 22 + (i/15)*15*5;
    break;
    case 11:
    j += 33 + (i/15)*15*6;
    break;
    case 12:
    j += 33 + (i/15)*15*6;
    break;
    case 13:
    j += 46 + (i/15)*15*7;
    break;
    case 14:
    j += 60 + (i/15)*15*8;
    break;
    }
    
  printf("%ld",j);
  return 0;
}