#include<bits/stdc++.h>
using namespace std;

struct Group{
	int indx, num;
	Group(){}
	Group(const int &_indx, const int &_num){
		indx = _indx; num = _num;
	}
};

int main(){
	int table[17], ans[100];
	queue<Group> q;
	for(int i = 0;; i++){
		if(i%5 == 0 && i/5 < 100){
			if( (i/5)%5 == 1 ) q.push( Group(i/5, 5) );
			else q.push( Group(i/5, 2) );
		}
		if( i/5 >= 100 && q.empty() ) break;
		
		Group q_c = q.front();
		int space_cnt = 0;
		for(int i = 16; i >= 0; i--){
			if(table[i] > 0) table[i]--;
			if(table[i] == 0) space_cnt++;
			else space_cnt = 0;
			
		}
	}
	return 0;
}