import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int[] n = new int[10];
Scanner in = new Scanner(System.in);
int i = 0;
//n[i] = in.nextInt();
while(true){
n[i] = in.nextInt();
if(n[i]==0){
break;
}
i++;
}
int[] n1 = new int[i];
for(int j = 0;j<i; j++){
int cnt = 0;
while(n[j]>1){
n[j] = n[j]-3+1;
cnt++;
}
n1[j] = cnt;
System.out.println(n1[j]);
}
}
}