1. 
/*
* ACM Contest training
* Problem: 11877 - The Coco-Cola Store
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=226&page=show_problem&problem=2999
*
* @author Christoph Goettschkes
* @version 1.0, 11/08/2010
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.108
*/

import java.io.*;

class Main
{
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

int n = Integer.parseInt(reader.readLine().trim());

while (n > 0) {
int d = 0;

int full = 0;
int empty = n;
int counter = 7;
while (empty > 0 && counter > 0) {
full = empty / 3;
empty %= 3;
d += full;
empty += full;
full = 0;
counter--;
if (empty == 2)
empty++;
}
System.out.println(d);

n = Integer.parseInt(reader.readLine().trim());
}
}
}