/** * @author johnsondu * @createTime 2015-8-16 17:04 @problem SGU Div 3 @url http://acm.sgu.ru/problem.php?contest=0&problem=105 @description math, print first 20 elements and find the rule behind it. 0 1 2 2 3 4 4 5 6 6 ... */ #include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include <cstring> #include <stack> #include <queue> #include <map> #include <vector> using namespace std; int main() { int n; while(cin >> n) { if (n < 4) cout << n - 1 << endl; else { if (n % 3 == 0 || n % 3 == 1) cout << n / 3 * 2 << endl; else cout << n / 3 * 2 + 1 << endl; } } return 0; }