import sys for line in sys.stdin: a = int(line.strip()) print((a - 1) // 3 * (1 + (a % 3 != 0)))
import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = in.nextLong(); int times = (n%3 == 0) ? 1:2; System.out.println(((n-1)/3)*times); } }
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void async function () { // Write your code here while(line = await readline()){ let tokens = line.split(' '); let n = parseInt(tokens[0]); let left=3,right=n-1 if(n<=3){ console.log(0) return 0 } while(right %3!==0) right-- let count = right/3 left = n-right let res = left % 3==0?count:count*2 console.log(res) } }()