#include <bits/stdc++.h>
using namespace std;
long long ar[500005 + 5];
int main() {
  long long i, j, k, n;
  cin >> n;
  if (n <= 2)
    cout << 1 << endl;
  else if (n == 3)
    cout << 2 << endl;
  else {
    long long lo = 1LL, hi = n, ans = 1LL;
    while (lo <= hi) {
      long long md = (lo + hi) / 2LL;
      if (md * 3LL <= n) {
        ans = max(ans, md);
        lo = md + 1LL;
      } else
        hi = md - 1LL;
    }
    if (ans * 3 + 1 <= n) {
      cout << (ans * 2) + 1 << endl;
    } else
      cout << ans * 2 << endl;
  }
  return 0;
}
