#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); }
int LCM(int a, int b) {
  int temp = GCD(a, b);
  return temp ? (a / temp * b) : 0;
}
bool isPrime(int number) {
  int i;
  for (i = 2; i < number; i++) {
    if (number % i == 0) return false;
  }
  return true;
}
ll dive(ll num) {
  ll sum = 0;
  ll sq = (ll)sqrt(num);
  for (int i = 1; i <= sq; i++)
    if (num % i == 0) sum++;
  if (sq * sq == num)
    sum = (2 * sum) - 1;
  else {
    sum = sum * 2;
  }
  return sum;
}
void printVec(vector<int> v2, string s = "") {
  cout << s;
  for (int i = 0; i < (int)v2.size(); ++i) cout << v2[i] << " ";
  cout << "\n";
}
void printVec_2D(vector<vector<int>> v2, int r, int c, string s = "") {
  int counter = 1;
  cout << s;
  for (int i = 0; i < r; i++)
    for (int j = 0; j < c; j++) {
      if (j == c - 1) {
        cout << v2[i][j] << endl;
      } else
        cout << v2[i][j] << " ";
    }
  cout << "\n";
}
void print_(vector<char> vc) {
  for (int i = 0; i < vc.size(); i++) cout << vc[i] << " ";
  cout << endl;
}
bool odd(int num) { return num % 2 != 0; }
ll combi(int n, int k) {
  long long ans = 1;
  k = k > n - k ? n - k : k;
  int j = 1;
  for (; j <= k; j++, n--) {
    if (n % j == 0) {
      ans *= n / j;
    } else if (ans % j == 0) {
      ans = ans / j * n;
    } else {
      ans = (ans * n) / j;
    }
  }
  return ans;
}
ll power(int base, int p) {
  ll result = base;
  for (int i = 0; i < p - 1; i++) {
    result *= base;
    if (result > 1000000007) result = result % 1000000007;
  }
  return result;
}
void w(int n) {
  int x = 0, y = 0, rep = 2;
  int i = 1;
  while (true) {
    if (i < 5) {
      if (i == n) {
        cout << x << " " << y << endl;
        return;
      }
      x++;
      i++;
      if (i == n) {
        cout << x << " " << y << endl;
        return;
      }
      x--;
      y++;
      i++;
      if (i == n) {
        cout << x << " " << y << endl;
        return;
      }
      x--;
      y--;
      i++;
      if (i == n) {
        cout << x << " " << y << endl;
        return;
      }
      x++;
      y--;
      i++;
      if (i == n) {
        cout << x << " " << y << endl;
        return;
      }
    } else {
      x++;
      i++;
      if (i == n) {
        cout << x << " " << y << endl;
        return;
      }
      for (int j = 0; j < rep - 1; j++) {
        x++;
        y++;
        i++;
        if (i == n) {
          cout << x << " " << y << endl;
          return;
        }
      }
      for (int j = 0; j < rep; j++) {
        x--;
        y++;
        i++;
        if (i == n) {
          cout << x << " " << y << endl;
          return;
        }
      }
      for (int j = 0; j < rep; j++) {
        x--;
        y--;
        i++;
        if (i == n) {
          cout << x << " " << y << endl;
          return;
        }
      }
      for (int j = 0; j < rep; j++) {
        x++;
        y--;
        i++;
        if (i == n) {
          cout << x << " " << y << endl;
          return;
        }
      }
      rep++;
    }
  }
}
int fun12(int n) {
  int c1 = 0, c2 = 0, pre = 2;
  while (n > 0) {
    if (pre == 1 || n == 2) return 0;
    if (pre == 2) {
      n--;
      c1++;
      pre = 1;
    }
    if (n >= 2) {
      n -= 2;
      c2++;
      pre = 2;
    }
  }
  return c1 + c2;
}
int fun21(int n) {
  int c1 = 0, c2 = 0, pre = 1;
  while (n > 0) {
    if (pre == 2 || n == 1) return 0;
    if (pre == 1 && n >= 2) {
      n -= 2;
      c2++;
      pre = 2;
    }
    if (pre == 2 && n >= 1) {
      n--;
      c1++;
      pre = 1;
    }
  }
  return c1 + c2;
}
int main() {
  int n;
  cin >> n;
  cout << max(fun12(n), fun21(n)) << endl;
  return 0;
}
