JAVA 代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
solve(n);
}
public static void solve(int n) {
int sum = 0;
int t = 1;
int cnt = 0;
while (sum < n) {
sum += t;
t *= 3;
cnt++;
}
System.out.println(cnt);
}
}