Polycarpus plays with red and blue marbles. He put n marbles from the left to the right in a row. As it turned out, the marbles form a zebroid.A non-empty sequence of red and blue marbles is a zebroid, if the colors of the marbles in this sequence alternate. For example, sequences (red; blue; red) and (blue) are zebroids and sequence (red; red) is not a zebroid.Now Polycarpus wonders, how many ways there are to pick a zebroid subsequence from this sequence. Help him solve the problem, find the number of ways modulo 1000000007 (109 + 7).

The first line contains a single integer n (1 ≤ n ≤ 106) — the number of marbles in Polycarpus's sequence.

Print a single number — the answer to the problem modulo 1000000007 (109 + 7).

NoteLet's consider the first test sample. Let's assume that Polycarpus initially had sequence (red; blue; red), so there are six ways to pick a zebroid:   pick the first marble;  pick the second marble;  pick the third marble;  pick the first and second marbles;  pick the second and third marbles;  pick the first, second and third marbles. It can be proven that if Polycarpus picks (blue; red; blue) as the initial sequence, the number of ways won't change.

#include<iostream>
using namespace std;
const int maxn = (int)1e6 + 10;
const int MOD = (int)1e9 + 7;
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n;
    cin>>n;
    long long res = 0,odd = 0,even = 0,cur;
    for(int i = 1; i <= n; i++)
    {
        if (i % 2 == 1)
        {
            odd = odd + even + 1;
            odd %= MOD;
        } else
        {
            even = even + odd + 1;
            even %= MOD;
    }
    }
    res = (odd + even) % MOD;
    cout<<res<<endl;
    return 0;
}

#include <iostream>
#include <stdio.h>
using namespace std;
const int N = 1000000007;
__int64 ans[1000000];
int main()
{
	ans[0]=1;
	ans[1]=3;
	int i;
	for(i = 2; i < 1000000; i++)
		ans[i] = (2 + ans[i-1] + ans[i-2])%N;
	for(int n;scanf("%I64d",&n)!=EOF;)
		printf("%I64d\n",ans[n-1]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

const int MAXN = 1e6+5;
const int INF = 1e9+7;
int dp[MAXN];
int MOD(int a){
    return (((a%INF)+INF)%INF);
}

int main()
{
    int *a = new int[MAXN];
    long long sum[2] = {};
    int n;cin >> n;
    for(int i=0;i<n;++i){
        int now = i&1;
        dp[i] = 1+sum[!now];
        sum[now] = MOD(sum[now] + dp[i]);
    }
    long long all  =0;
    for(int i=0;i<n;++i){
        all = MOD(MOD(all) + MOD(dp[i]));
    }
    cout << all;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
const int mod = 1e9+7;
const int maxn = 1e6+100;
int a[maxn];
int dp[maxn][2];
int main()
{
	int n;
	scanf("%d", &n);
	dp[0][0] = 1, dp[0][1] = 1;
	ll pre0 = 0, pre1 = 0;
	for(int i = 1; i <= n; i++) {
		if(i&1) {
			dp[i][1] = (pre0 + i) % mod;
			pre1 = (dp[i][1] + pre1) % mod;
		}else {
			dp[i][0] = (pre1 + i) % mod;
			pre0 = (pre0 + dp[i][0]) % mod;
		}
	}
	if(n&1)
		cout<<dp[n][1]<<endl;
	else cout<<dp[n][0]<<endl;
}

//
//	ID: y0rkl1u
//	PROG: codeforces 209A. Multicolored Marbles
//	LANG: C++
//	DATE: 05.27.2016
//	NOTE: dp
//

#include <bits/stdc++.h>
using namespace std;

#define reg register
#define rint reg int
#define For(i,l,r) for(rint i=(l),_c=(r);i<=_c;i++)
typedef long long ll;

const int mod=1000000007;
int add(int a,int b)
{
	a+=b;return a>=mod?a-mod:a;
}
#define inc(a,b) (a=add(a,b))
const int MN=1000011;
int f[MN][2],n;
inline void Main()
{
	f[0][0]=f[0][1]=1;
	scanf("%d",&n);
	For(i,1,n)For(j,0,1)if(f[i-1][j]){
		inc(f[i][j],f[i-1][j]);
		if(j!=i%2)inc(f[i][i%2],f[i-1][j]);
	}
	rint ans=add(add(f[n][0],f[n][1]),mod-2);
	printf("%d\n",ans);
}
int main()
{
	Main();
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define zero(n) memset(n,0,sizeof(n))
#define init(n) memset(n,-1,sizeof(n))
#define REP(i,n) for(i=0;i<n;i++)
#define FOR(i,a,b) for(i=a;i<=b;i++)
#define FORD(i,a,b) for(i=a;i>=b;i--)
#define FOR2(i,a,b,c) for(i=a;i<=b;i+=c)
#define FORD2(i,a,b,c) for(i=a;i>=b;i-=c)
#define mod(x,y) (((x%y)<0)?((x%y)+y):(x%y))
#define PB push_back
#define endll "\n"
#define INF 0x7FFFFFFF
#define MOD 1000000007
typedef long long int ll;
typedef pair<int,int> ii;

ll n,m,len;

ll arr[1000010];
ll dp[1000010];

ll dfs(ll ind){
	if(ind == n-1) return 1;

	if(dp[ind] != -1) return dp[ind];

	ll l = 0; if(ind+1 <= n-1) l = dfs(ind+1);
	ll r = 0; if(ind+2 <= n-1) r = dfs(ind+2);

	return dp[ind] = (2+((l+r)%MOD))%MOD;
}

int main(){
	ll i,j,k,t,a,b;
	//ios_base::sync_with_stdio(0);
	//cin.tie(NULL);
	//cout.tie(NULL);

	//freopen("input.in", "r",stdin);
	//freopen("output.out","w",stdout);

	cin >> n;

	memset(dp,-1,sizeof(dp));
	cout << dfs(0) << endll;

	return 0;
}

//  Copyright © 2020 Kavish Lodha. All rights reserved.
#include <bits/stdc++.h>
using namespace std;
#define vll vector<long long>
#define mll map<long long,long long>
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a>b)?b:a)
#define pb push_back
#define prll pair<long long,long long>
typedef long long ll;
typedef long double ld;
#define rep(i,a,n)   for(ll i=a; i<n; i++)
#define rrep(i,a,n)  for(ll i=n-1; i>=a; i--)
typedef map<string,ll> msl;
#define mx 100001
#define mod 1000000007
ll gcd(ll a, ll b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
ll extgcd(ll a,ll b,ll& x,ll& y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll x1, y1;
    ll d = extgcd(b, a % b, x1, y1);
    x = y1;
    y = x1 - y1 * (a / b);
    return d;
}
ll revrsno(ll n){
    ll k=0;
    vll z;
    while(n>0){
        z.pb(n%10);
        n/=10;
    }
    rep(i,0,z.size()) k=k*10+z[i];
    return k;
}
bool isPrime(ll n){
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (ll i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
    return true;
}
bool isPowerOfTwo(ll n) {
   if(n==0)
   return false;
   return (ceil(log2(n)) == floor(log2(n)));
}
ll powm(ll a,ll b) {
	ll res = 1;
	while (b) {
		if (b & 1)
			res = (res * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return res;
}
ll divide(ll a,ll b) {
	return (a % mod) * powm(b, mod - 2) % mod;
}
ll mul(ll a,ll b) {
	return ((a % mod) * (b % mod)) % mod;
}

ll add(ll a,ll b) {
	return (a % mod + b % mod) % mod;
}
ll Totfun(ll n){
    ll z=n;
    if(n%2==0){
        while(n%2==0){
            n/=2;
        }
        z/=2;
    }
    for(ll i=3;i<=sqrt(n);i+=2){
        if(isPrime(i)&&n%i==0){
          while(n%i==0){
            n/=i;
          }
        z-=z/i;
        }
    }
    if(n>1){
        z-=z/n;
    }
    return z;
}
ll maxPrimeFactor(ll n) {
    ll maxPrime=-1;
    while(n%2==0){
        maxPrime=2;
        n>>=1;
    }
    for (ll i=3;i<=sqrt(n);i+=2) {
        while(n%i==0){
            maxPrime=i;
            n=n/i;
        }
    }
    if (n>2) maxPrime=n;
    return maxPrime;
}
ll nCr(ll n,ll r){
    if(r>n||r<0) return 0;
    ll z=1,a=1,b=1;
    rep(i,1,n+1){
      z=mul(z,i);
    }
    rep(i,1,r+1){
      a=mul(a,i);
    }
    rep(i,1,n-r+1){
      b=mul(b,i);
    }
    return mul(mul(z,powm(a,mod-2)),powm(b,mod-2));
}
/*
vll a[mx];
ll l[mx],d[mx];
void dfs(ll x,ll y){
   l[x]=1; d[x]=y;
   for(ll i:a[x])
   if(!l[i])
   dfs(i,y+1);
}
void bfs(ll x){
    queue<ll> q;
    q.push(x);
    l[x]=1;
    d[x]=0;
    while(!q.empty()){
        ll cur=q.front();
        q.pop();
        for(ll i : a[cur]){
            if(1-l[i]){
                q.push(i);
                d[i]=d[cur]+1;
                l[i]=1;
            }
        }
    }
}
*/
 /*sort(a,a+n);
    ll d=1;
    vll z;
    for(ll i=1;i<n;i++){
    if(a[i]==a[i-1]){
        d++;
    }
    else{
            z.pb(d);
            d=1;
    }
    }
    z.pb(d);*/
int main(){
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   cout.tie(NULL);
    ll n;
    cin>>n;
    ll a[n][2]={0};
    a[0][0]=1;
    rep(i,1,n){
          a[i][i%2]++;
          a[i][i%2]+=a[i-1][1-i%2]%1000000007;
          a[i][1-i%2]=a[i-1][1-i%2]%1000000007;
          a[i][i%2]+=a[i-1][i%2]%1000000007;
    }
   cout<<(a[n-1][0]+a[n-1][1])%1000000007;
   return 0;
}

/// {{{ by WangYenJen
#include <bits/stdc++.h>

using namespace std;

// types
typedef long long ll;
typedef pair<int,int> pii;

// macro
#define F first
#define S second
#define SZ(x) ((int)x.size())
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin() , (x).end()
#define REP(i , n) for(int i = 0; i < int(n); i++)
#define REP1(i , a , b) for(int i = (a); i <= int(b); i++)
#define PER(i , n) for(int i = (n) - 1; i >= 0; i--)
#define PER1(i , a , b) for(int i = (a); i >= int(b); i--)
#define LC o<<1 , l , m
#define RC o<<1|1 , m + 1 , r
#define MS(x , v) memset(x , (v) , sizeof(x))

// input
inline bool SR(int &x) {
	return scanf("%d",&x) == 1;
}

inline bool SR(ll &x) {
	return scanf("%lld",&x) == 1;
}

inline bool SR(double &x) {
	return scanf("%lf",&x);
}

inline bool SR(char *s) {
	return scanf("%s",s);
}

inline bool RI() {
	return 1;
}

template<typename I , typename... T>
bool RI(I &x , T&... tail) {
	return SR(x) && RI(tail...);
}

// output
inline void SP(const int x) {
	printf("%d",x);
}

inline void SP(const ll x) {
	printf("%lld",x);
}

inline void SP(const double x) {
	printf("%.10f",x);
}

inline void SP(const char *s) {
	printf("%s",s);
}

inline void PL() {
	puts("");
}

template<typename I , typename... T>
void PL(const I x , const T... tail) {
	SP(x);
	if(sizeof...(tail)) putchar(' ');
	PL(tail...);
}

// debug function
#define WangYenJen

#ifdef WangYenJen
template<typename I>
inline void _DOING(const char *s , I&& x) {
	cerr << s << " = " << x << '\n';
}

template<typename I , typename... T>
void _DOING(const char *s , I&& x , T&&... tail) {
	int c = 0;
	while(*s != ',' || c != 0) {
		if(*s == '(' || *s == '[' || *s == '{') c++;
		if(*s == ')' || *s == ']' || *s == '}') c--;
		cerr << *s++;
	}
	cerr << " = " << x << " , ";
	_DOING(s + 1 , tail...);
}

#define DEBUG(...) \
	do { \
		fprintf(stderr , "%s : %d - " , __PRETTY_FUNCTION__ , __LINE__); \
		_DOING(#__VA_ARGS__ , __VA_ARGS__); \
	} while(0);

#else
#define DEBUG(...)
#endif

// constant number
const int INF = 0x3f3f3f3f;
const ll INF64 = 0x3f3f3f3f3f3f3f3fll;

// random function
inline int RAND() {
	static int x = 880301;
	return x = (x * 0xdefacedll + 1ll) % 0x7fffffffll;
}
/// }}}

const int MAX_N = 1000000 + 7;
const int MOD = 1000000000 + 7;

int dp[2];

int main() {
	int n;
	RI(n);
	int ans = 0;
	REP1(i , 1 , n) {
		dp[i&1] += dp[~i&1] + 1;
		ans += dp[~i&1] + 1;
		if(dp[i&1] >= MOD) dp[i&1] -= MOD;
		if(ans >= MOD) ans -= MOD;
	}
	PL(ans);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define io ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define endl '\n'
#define mod 1000000007
#define pii pair<ll, pair<ll, ll>>
ll n;
ll solve() {
	cin>>n;
	ll r[n], b[n];
	r[n - 1] = 1;
	b[n - 1] = 0;
	char c = 'b';
	ll ans = 1;
	for(int i = n-2; i >= 0; i--) {
		ll cur = 1 + (c == 'r' ? b[i + 1] : r[i + 1]);
		b[i] = 0;
		r[i] = 0;
		if(c == 'b') {
			b[i] += cur;
			b[i] %= mod;
			b[i] += b[i+1];
			b[i] %= mod;
			r[i] = r[i+1];
		}
		else {
			r[i] += cur;
			r[i] %= mod;
			r[i] += r[i+1];
			r[i] %= mod;
			b[i] = b[i+1];
		}
		ans += cur;
		ans %= mod;
		//cout<<dp[i]<<' '<<r[i]<<' '<<b[i]<<endl;
		c = (c == 'r' ? 'b' : 'r');
	}
	if(ans < 0) ans += mod;
	return ans;
}
int main() {
	io
	ll t = 1;
	//cin>>t;
	while(t--) {
		cout<<solve()<<endl;
		//solve();
	}
}

#include <cstdio>
#include <algorithm>
using namespace std;
#define int64 long long
const int64 M=1000000007;
int n,i;
int64 s0, s1;
int main ()
{
//    freopen ("input.in", "r", stdin);
//    freopen ("output.out", "w", stdout);
    scanf("%d",&n);
    s0=s1=0;
    for(i=1;i<=n;i++)
    {
        swap(s0,s1);
        s0=(s0+s1+1)%M;
    }
    printf("%I64d",(s0+s1)%M);
    return 0;
}

#include <iostream>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
using namespace std;
int f[1111111];
int main(){
	//freopen("in","r",stdin);
	int n; cin>>n;
	f[0]=1;
	f[1]=1;
	for(int i=2;i<=n+2;i++){
		f[i]=(f[i-1]+f[i-2])%1000000007;
	}
	cout<<f[n+2]-2;
	return 0;
}

#include <cstdio>
using namespace std;

const int INF = 1000000007;

int main(){
    int n,dp[2]={1,1};
    scanf("%d",&n);
    for(int i=0;i<n;i++) dp[i&1]=(dp[i&1]+dp[~i&1])%INF;
    printf("%d\n",((dp[0]+dp[1])%INF+INF-2)%INF);
}

#include <iostream>
using namespace std;
const int mod=1e9+7;

int n;

int main()
{
    int i;
    int sumred=0,sumblue=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        if(i%2)   // is red
            sumred=(sumred+sumblue+1)%mod;
        else
            sumblue=(sumblue+sumred+1)%mod;
    }

    cout<<(sumred+sumblue)%mod<<endl;
    return 0;
}

#include<cstdio>
#include<cstring>
const __int64 maxn=1000005;
const __int64 mod=1000000007;
__int64 dp[maxn];
int  main()
{
    __int64 n;
    __int64 i,j,k;
    while(scanf("%I64d",&n)!=-1)
    {
        memset(dp,0,sizeof(dp));
        __int64 ji=0,ou=0;
        __int64 ans=0;
        for(i=0;i<n;i++)
        {
            dp[i]=1;
            if(i%2)
            {
                dp[i]+=ou;
                ji+=dp[i];
            }
            else
            {
                dp[i]+=ji;
                ou+=dp[i];
            }
            dp[i]%=mod;
            ji%=mod;
            ou%=mod;
            ans+=dp[i];
            ans%=mod;
        }
        printf("%I64d\n",ans);
    }
    return 0;
}

#include<bits/stdc++.h>
#include<math.h>
#include<algorithm>
using namespace std;

const double pi=3.141592653589;
const long long int zero=0;
long long int mod = 1000000007;
char al[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

#define sc1(a) scanf("%d",&a)
#define sc2(a,b) scanf("%d%d",&a,&b)
#define sc3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define pr1(a) printf("%d\n",a)
#define prs(a) printf("%d ",a)
#define pry  printf("YES\n")
#define prn  printf("NO\n")
#define pr2(a,b) printf("%d %d\n",a,b)
#define pr3(a,b,c) printf("%d %d %d\n",a,b,c)
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define rloop(i,a,b) for(ll i=a;i>=b;i--)
#define ll long long int
#define ld long double
#define lvec vector<long long int> v
#define vec vector<int> v
#define ite1 vector<int>:: iterator it1
#define ite2 vector<int>:: iterator it2
#define ite3 vector<int>:: iterator it3
#define mp make_pair
#define pb push_back
#define pf push_front
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second

/*ll power(ll x, ll y, ll p)
{
    ll res = 1;

    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}

ll ncr(ll n, ll r, ll p)
{
   if (r==0)
      return 1;

    ll fac[n+1];
    fac[0] = 1;
    for (ll i=1 ; i<=n; i++)
        fac[i] = fac[i-1]*i%p;

    return (fac[n]* modInverse(fac[r], p) % p *
            modInverse(fac[n-r], p) % p) % p;
}*/

int main()
{
    int t=1;

    //cin>>t;           // comment this line when number of testcases = 1

    while(t--)
    {
        int n;
        cin>>n;
        ll dp[n][2];
        dp[0][0]=1;
        dp[0][1]=0;

        loop(i,1,n)
        {
            if(i%2==1)
            {
                dp[i][0]=dp[i-1][0];
                dp[i][1]=dp[i-1][0]+dp[i-1][1]+1;
                dp[i][1]%=mod;
            }
            else
            {
                dp[i][1]=dp[i-1][1];
                dp[i][0]=dp[i-1][0]+dp[i-1][1]+1;
                dp[i][0]%=mod;
            }
        }

        cout<<(dp[n-1][0]+dp[n-1][1])%mod;

    }
}

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long

main(){
	int n;
	cin >> n;
	int r;
	int b;
	r = 1;
	b = 0;
	int m = 1000000007;
	for (int i = 1; i < n; ++i){
		if (i % 2 == 1){
			b = 1 + r + b;
		}
		else{
			r = 1 + r + b;
		}
		while (b > m){
			b -= m;
		}
		while (r > m){
			r -= m;
		}
	}
	//cout << m << "\n";
	cout << (r + b)%m << "\n";

}

/**Bismillahir Rahmanir Rahim.**/
#include<bits/stdc++.h>
#define ln '\n'
#define sf scanf
#define pf printf

#define D(x) cout<< #x " = "<<x<<endl
#define cout(case)   cout << "Case " << ++cs << ": " ;
#define foreach(i,c) for(__typeof(c.begin())i=c.begin();i!=c.end();i++)

#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(int i=(a);i!=(b);i+=(c))
#define _case cout<<"Case "<<++cs<<": "
#define lp(loop,start,end) for(ll loop=start;loop<=end;loop++)
#define lpd(loop,start,end) for(ll loop=end;loop>=start;loop--)

#define MOD 1000000007
#define countv(v,a) count(v.begin(),v.end(),a)
#define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define uniq(v) v.resize( unique(all(v)) - v.begin())

#define PI acos(-1)
#define ll long long int
#define ull unsigned long long

#define vi vector <int>
#define vll vector <ll>
#define vs vector <string>
#define pb push_back
#define mpii map <int,int>
#define mpsi map <string,int>
#define mpll map <long long,long long>
#define MP make_pair
#define F first
#define S second

#define GCD(a,b) __gcd(a,b)
#define LCM(a,b) (a*(b/__gcd(a,b)))

#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())

#define all(v) v.begin(),v.end()
#define MEM(a, b) memset(a, b, sizeof(a))

#define fast ios_base::sync_with_stdio(false)
using namespace std;

const ll INF = 0x3f3f3f3f3f3f3f3f;
const long double EPS = 1e-9;
const int inf = 0x3f3f3f3f;
/// count set bit C = (num * 0x200040008001ULL & 0x111111111111111ULL) % 0xf;

int dx[] = { 0, 0, 1, -1 }; /// 4 Direction
int dy[] = { 1, -1, 0, 0 };

/// int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
/// int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction
/// int dx[]={2,1,-1,-2,-1,1};int dy[]={0,1,1,0,-1,-1}; //Hexagonal Direction

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N  (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

typedef struct {
    double x,y;
} Point;

double distance(Point a , Point b) {
    return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}

string s,s1;
ll n,m,a,b,i,j,d,t,cs=2,counT=0,k,ans=0,l=0,sum1=0,sum=0,Max,Min,num;
ll arr[10000009];
vector<ll>vc;
map<ll,ll>mp;

int main()
{
    arr[1] = 1 ,arr[2]=3;
    for(i=3;i<10000009;i++)
    {
        arr[i] = (arr[i-1]+arr[i-2]+2) % MOD ;

    }
//D(arr[7]);

    cin >> n;

    cout << arr[n] << ln ;

}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <algorithm>
#include <unordered_map>
#define int                long long
#define pb                 push_back
#define pi                 pair<int,int>
#define vi                 vector<int>
#define all(v)             v.begin(),v.end()
#define MOD                1000000007
#define F                  first
#define S                  second
#define FOR(i,r)           for(int i=0;i<r;i++)
#define REP(i,l,r)         for(int i=l;i<r;i++)
#define RER(i,l,r)         for(int i=l;i>=r;i--)
#define print(v)           for(auto i : v)cout << i << ' ';
#define FASTIO             ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mem(arr,k)         memset(arr,k,sizeof(arr));
#define pii                acos(-1.0)
#define PI                 3.1415926535897932385
#define Sin(a)             sin((pi*a)/180)
#define test()             int x;cin >> x;while(x--)
using namespace std;
int32_t main(){

	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
	FASTIO;
	int n;
	cin >> n;
	int dp[n+1];
	REP(i,0,n)
	  dp[i] = 1;
	int o=0,e=0;
	RER(i,n-1,0){
		if(i%2==0){
			dp[i] += o;
		}
		else
			dp[i] += e;
		if(i&1)
			o += dp[i];
		else
			e += dp[i];
		o  %= MOD;
		e  %= MOD;
		dp[i] %= MOD;
	}
	int ans = 0;
	REP(i,0,n){
		ans += dp[i];
		ans %= MOD;
	}
	cout << ans << endl;
    return 0;

}

#include<iostream>
#include<cstring>
#include<stdio.h>
using namespace std;
long long a[1000001]={0,1,3};
int main()
{
	int i=3;
	for(;i<=1000000;i++)
	{
		a[i]=(a[i-1]%1000000007+a[i-2]%1000000007+2)%1000000007;
	}
	int n;
	while(cin>>n)
	{
		cout<<a[n]<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define Flash ios_base::sync_with_stdio(false); cin.tie(NULL)
#define all(v) v.begin(),v.end()
#define rev(v) reverse(all(v))
#define sot(v) sort(all(v))
#define printa(a,L,R) for(int i=L;i<R;i++) cout<<a[i]<<(i==R-1?'\n':' ')
#define printv(a) printa(a,0,a.size())
#define print2d(a,end,c) for(int i=0;i<end;i++) for(int j=0;j<c;j++) cout<<a[i][j]<<(j==c-1?'\n':' ')
#define mem(a,x) memset(a,x,sizeof(a))

const int N = (int) 1e5 + 7;
const int MOD = (int) 1e9 + 7;
const ll INF = (ll) 1e18;

using namespace std;

int main() {
    Flash;
    ll n;
    cin >> n;
    vector<vector<ll>> dp(n+1, vector<ll>(2));
    for(int i = 1; i <= n; i++) {
        if(i&1) {
            dp[i][1] = (dp[i-1][0] + dp[i-1][1] + 1)%MOD;
            dp[i][0] = dp[i-1][0];
        } else {
            dp[i][0] = (dp[i-1][1] + dp[i-1][0] + 1)%MOD;
            dp[i][1] = dp[i-1][1];
        }
    }
    cout << (dp[n][0] + dp[n][1])%MOD;
    return 0;
}

using namespace std ;
#include<bits/stdc++.h>
#include<cstdio>
#include<iostream>
#define int long long
#define ld long double
#define pld pair<ld , ld>
#define F first
#define S second
#define cerr cout << "*" << endl
#define pii pair <int , int>
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define vi vector <int>
#define si set<int>
#define msi multiset <int>
#define qi queue<int>
#define ashari cout << setprecision(10)
// #define cin fin
// #define cout fout
const int inf = 1e18 ;
const int mod = 1e9 + 7  ;
const int maxn = 1e7 + 10 ;

int n , dp[1000010] , fa[1000010] , zo[1000010] , suf[1000010] , suz[1000010] ;
main()
{
  fast ;
  cin >> n ;
  dp[1] = 1 ;
  fa[1] = 1;
  suf[1] = 1;
  for(int i = 2 ; i <= n ; i ++)
    {
      if(i % 2)
	{
	  fa[i] = (suz[i - 1] + 1) % mod ;
	  suf[i] = (suf[i - 2] + fa[i]) % mod ;
      dp[i] = (dp[i -1] + fa[i] ) % mod;
	}
      else
	{
	  zo[i] = (suf[i - 1]  + 1) % mod;
	  suz[i] =( suz[i - 2] + zo[i]) % mod ;
	  dp[i] = (dp[i - 1] + zo[i]) % mod ;
	}
      //      cout << i << " " << fa[i] << " " << zo[i] << " "<<dp[i] << endl ;
    }
  cout << dp[n] ;
}

#include<iostream>
using namespace std;

const int mod = 1e9 + 7, nax = 1e6+5;
int n, dp[nax], sum[nax];

void add_self(int& a, int b) {
	a += b;
	if (a >= mod) a -= mod;
}

int main()
{
	cin >> n; //dp[i] = answer at i
	for (int i = 1; i <= n; i++) {
		dp[i] = 1;
	}
	int sum_odd = 1, sum_even = 0;
	for (int i = 2; i <= n; i++) {
		if (i & 1) {
			add_self(dp[i], sum_even);
			add_self(sum_odd, dp[i]);
		}
		else {
			add_self(dp[i], sum_odd);
			add_self(sum_even, dp[i]);
		}

	}
	int ans = 0;
	for (int i = 1; i <= n; i++) add_self(ans, dp[i]);
	cout << ans << endl;

	return 0;
}

#include <iostream>
#include <utility>
#include <queue>
#include <vector>
#include <cstring>
#include <iterator>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <iomanip>
#include <string>
#include <deque>
#include <algorithm>
#define endl "\n"
#define pb push_back
#define ll long long int
using namespace  std;
ll mod=1000000007;
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
ll n;
cin>>n;
ll dp[1000005];
dp[1]=2;
dp[2]=3;
for(int i=3;i<=n;i++)dp[i]=(dp[i-1]%mod+dp[i-2]%mod)%mod;
ll ans[1000005];
ans[1]=1;
for(int i=2;i<=n;i++)ans[i]=(ans[i-1]%mod+dp[i-1]%mod)%mod;
cout<<ans[n]%mod;
return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define M 1000000007
ll sum_fib(ll n)
{
    ll sum=0;
    ll f1=1;
    ll f2=2;
    sum=3;
    for(int i=3;i<=n;i++)
    {
        ll temp=f2%M;
        f2=(f1%M+f2%M)%M;
        sum=(sum%M+f2%M)%M;
        f1=temp%M;

    }
    return sum;
}
main()
{
    int n;
    cin>>n;
    if(n==1){cout<<1;return 0;}
    if(n==2){cout<<3;return 0;}
    ll ans=sum_fib(n);
    cout<<ans;
    return 0;
}

#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define pa pair<int,int>
using namespace std;
const int mod=1e9+7;
const int MAX=1e6+5;
ll reds=1,blues=0;
ll dp[MAX];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    if (n==1)cout<<"1";
    else
    {
        dp[1]=1;
        for (int i=2;i<=n;i++)
        {
            if (i%2==0)
            {
                dp[i]=reds+1;
                dp[i]%=mod;
                blues+=dp[i];
                blues%=mod;
            }
            else
            {
                dp[i]=blues+1;
                dp[i]%=mod;
                reds+=dp[i];
                reds%=mod;
            }
        }
        ll ans=0;
        for (int i=1;i<=n;i++)
        {
           ans+=dp[i];
           ans%=mod;
        }
        cout<<ans;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll dp[2000000];
ll bg = 1000000007;
int main()
{
    ll n,i,j,m,k,t;
    cin>>n;
    dp[1]=1;
    for(i=2;i<=n;i++)
      dp[i] = (((dp[i-1]+dp[i-2]))%bg+2)%bg;
    cout<<dp[n];
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define M 1000000007

ll fun( ll n )
{
    ll *dp = new ll[n+1]();
    for(int i=0;i<=n;i++)
        dp[i] = 1;
    ll odds=0 , evens =0;

    for(int i=1;i<=n;i++)
    {
        if( i%2==0)
        {
            dp[i] = (odds + dp[i] )%M;
            evens = (evens + dp[i])%M;
        }
        else
        {
            dp[i] =( evens+ dp[i])%M;
            odds = (odds+ dp[i] )%M;
        }
    }
    ll ans =0;
for(int i=1;i<=n;i++)
{
    ans =( ans+dp[i] )%M;
}
return ans;
}
int main()
{
    ll n;
    cin>>n;
    cout<<fun(n);
}

/*Author--Vishwas Agrawal*/
/*Author--Vishwas Agrawal*/
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define vll vector<ll>
#define pb push_back
#define mp make_pair
#define test    \
      ll t;     \
      cin >> t; \
      while (t--)
#define fio                             \
      ios_base::sync_with_stdio(false); \
      cin.tie(NULL);                    \
      cout.tie(NULL);
#define M 1000000007LL
#define input(v, n)   \
      inc(i, 0, n)    \
      {               \
            ll x;     \
            cin >> x; \
            v.pb(x);  \
      }
#define print(v, n) \
      inc(i, 0, n) { cout << v[i] << " "; }
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define inc(i, a, n) for (ll i = a; i < n; i++)
#define dec(i, a, n) for (ll i = n - 1; i >= a; i--)
long long binpow(long long base, long long exp, int mod)
{
      long long res = 1;
      while (exp > 0)
      {
            if (exp % 2 == 1)
                  res = (res * base) % mod;
            exp = exp >> 1;
            base = (base * base) % mod;
      }
      return res;
}
long long mod(long long x)
{
      return ((x % M + M) % M);
}

long long add(long long a, long long b)
{
      return mod(mod(a) + mod(b));
}

long long mul(long long a, long long b)
{
      return mod(mod(a) * mod(b));
}

int main()
{
      ll n;
      cin >> n;
      if (n <= 2)
      {
            if (n == 2)
            {
                  cout << 3 << endl;
            }
            else
                  cout << 1 << endl;
      }
      else
      {
            ll dp[n];
            dp[n - 1] = 1;
            dp[n - 2] = 2;
            ll ans = 3;
            for (ll i = n - 3; i >= 0; i--)
            {
                  dp[i] = (dp[i + 1] + dp[i + 2]) % M;
                  ans = (ans + dp[i]) % M;
            }
            cout << ans << endl;
      }

      return 0;
}

#include<iostream>
using namespace std;
typedef long long int64;
int64 dp[1000005];
int64 mod=1000000007;
int  main(){
	dp[1]=1;
	dp[2]=3;
	dp[3]=6;
	for(int64 i=4;i<=1000000;i++){

			 dp[i]=(  (2+dp[i-1])%mod+dp[i-2])%mod;

		}

	int64 n;
	while(cin>>n)
		cout<<dp[n]%mod<<endl;

}

#include <iostream>
#include <cmath>
#include <fstream>

using namespace std;

const int dim = 1000003;
const int mod = 1000000007;

long long int n,dp[dim];

int main()
{
    cin >> n;
    dp[1] = 1;
    dp[2] = 3;
    dp[3] = 6;
    dp[4] = 11;
    if (n == 1)
    {
        cout << "1";
        return 0;
    }
    if (n == 2)
    {
        cout << "3";
        return 0;
    }
    if (n == 3)
    {
        cout << "6";
        return 0;
    }
    for (int i=4; i<=n; i++)
    {
        dp[i] = (mod + (2*dp[i-1])%mod - dp[i-3])%mod;
    }
    cout << dp[n];
    return 0;
}

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int i,n,m,sum1,sum2;
const int mo=1000000007;
int main(){
	scanf("%d",&n);
	for(i=1;i<=n;++i){
		if(i&1)sum2=(sum2+sum1+1)%mo;
		else sum1=(sum1+sum2+1)%mo;
	}
	printf("%d\n",(sum1+sum2)%mo);
}

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	ll n,dp[1000050],mod=1e9+7;
	cin >> n;
	ll juma=0,jumb=0;
	for(int i=1; i<=n; i++){
		dp[i]=1;
		if(i%2==1){
			dp[i]+=jumb%mod;
			dp[i]%=mod;
			juma+=dp[i]%mod;
			juma%=mod;
		}
		else{
			dp[i]+=juma%mod;
			dp[i]%=mod;
			jumb+=dp[i]%mod;
			jumb%=mod;
		}
	}
	ll jwb=0;
	for(int i=1; i<=n; i++){
		jwb+=dp[i]%mod;
		jwb%=mod;
	}
	cout << jwb << endl;
}

#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
using namespace std;
ll n;
ll dp[1000005];
bool visited[1000005];

ll fun(ll idx)
{
	ll i;
	ll mod=1000000007;
	if(idx>n)
	return 0;
	if(visited[idx])
		return dp[idx];
	visited[idx]=true;
	for(i=1;i<n;i++)
	{
		if(idx+i<=n)
		dp[idx]=dp[idx]+(1+fun(idx+i));
		cout<<idx<<" "<<dp[idx]<<"\n";
	}
	return dp[idx];

}

int main()
{
	for(ll i=0;i<1000005;i++)
	{
		dp[i]=0;
		visited[i]=false;
	}
	cin>>n;
		ll mod=1000000007;
	//ll ans=fun(1);
	dp[1]=1;
	dp[2]=3;

	for(ll i=3;i<=n;i++)
	{
		dp[i]=(dp[i-1]+dp[i-2]+2)%mod;
	}
	cout<<dp[n];
}

#include<bits\stdc++.h>
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define infi INT_MAX
#define inf 1LL<<60
#define ff first
#define ss second
using namespace std;
const int mod=1e9+7;
main()
{
    fast
    int tc,i,j,k;
    tc=1;
    while(tc--)
    {
      int a;
      cin>>a;
      if(a==1)
        cout<<1<<endl;
      else if(a==2)
        cout<<3<<endl;
      else{

      int aa[a];
      aa[a-2]=1;
      aa[a-3]=3;
      k=3;
      for(i=a-4;i>=0;i--){
        aa[i]=(aa[i+1]+aa[i+2]+k)%mod;
        k++;
     //  cout<<aa[i]<<endl;
      }
    aa[0]=(aa[0]+a)%mod;
    cout<<aa[0]<<endl;
      }
    }
}

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
#define Mod 1000000007
long long m[1000005];
int main()
{
	long long n;
	scanf("%I64d",&n);
	m[1]=1;
	m[2]=3;
	for(int i=3;i<=1000000;i++)
	{
		m[i]=(m[i-2]+m[i-1]+2)%Mod;
	}
	printf("%I64d\n",m[n]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define str string
#define pb push_back
#define vc vector
#define ci cin
#define co cout
#define mod 1000000007

int main()
{
	 #ifndef ONLINE_JUDGE
	 freopen("input.txt","r",stdin);
	 freopen("output.txt","w",stdout);
	 freopen("error.txt","w",stderr);
    #endif

	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll x=0,y=0;
    for(int i=0;i<n;i++)
    {
    	if(i%2!=0)
    		x=(x+y+1)%mod;
    	else
    		y=(x+y+1)%mod;
    }
    cout<<(x+y)%mod;

}

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector< vector<int> > VVI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define REP(i, n) for(int i = 0; i < n; ++i)
#define RREP(i, n) for(int i = n - 1; i >= 0; --i)
#define FOR(i, x, y) for(int i = x; i <= y; ++i)
#define RFOR(i, x, y) for(int i = x; i >= y; --i)
#define SZ(a) (ll)(a).size()
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define CLEAR(x) memset(x,0,sizeof x);
#define UNIQUE(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define pb push_back
#define sqr(x) (x)*(x)
#define X first
#define Y second

const double pi=acos(-1.0);
const double eps = 1e-9;
const int INF = 1000000000;

const ll MOD = 1000000007;
int l, r, n;

int main()
{
  cin >> n;
  REP(i, n)
  {
    if (i % 2)
      l = (l + r + 1) % MOD;
    else
      r = (r + l + 1) % MOD;
  }
  cout << (l + r) % MOD << endl;
}

#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll dp[1069696];

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll mod=1000000007;
	ll n;
	cin >> n;
	ll juma=0,jumb=0;
	for(int i=1; i<=n; i++){
		dp[i]=1;
		if(i%2==1){
			dp[i]+=jumb%mod;
			dp[i]%=mod;
			juma+=dp[i]%mod;
			juma%=mod;
		}
		else{
			dp[i]+=juma%mod;
			dp[i]%=mod;
			jumb+=dp[i]%mod;
			jumb%=mod;
		}
	}
	ll jwb=0;
	for(int i=1; i<=n; i++){
		jwb+=dp[i]%mod;
		jwb%=mod;
	}
	cout << jwb << endl;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define forr(i, a, b) for(int i=a; i<(b); i++)
#define forn(i, n) forr(i, 0, n)
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

const int MOD = 1000000007;

int main(){FIN;
	int n;
    cin >> n;
    int d[2];
    d[0] = 1;
    d[1] = 1;
    forn(i, n) {
        int p = i % 2;
        int q = (i + 1) % 2;
        d[q] = (d[q] + d[p]) % MOD;
    }
    int res = d[0] + d[1];
    res -= 2;
    res %= MOD;
    res += MOD;
    res %= MOD;
    cout << res << "\n";
	return 0;
}

// read the question correctly (ll vs int)

#include <bits/stdc++.h>

using namespace std;

const int mod = 1e9 + 7;
int n, a[2];

int main() {
	ios::sync_with_stdio(0); cin.tie(0);

	cin >> n;
	for (int i = 0; i < n; i++) a[i % 2] = (a[i % 2] + a[(i + 1) % 2] + 1) % mod;
	cout << (a[0] + a[1]) % mod << '\n';
}

#include <iostream>
using namespace std;
const int mod=1e9+7;

int n;

int main()
{
    int i;
    int sumred=0,sumblue=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        if(i%2)   // is red
            sumred=(sumred+sumblue+1)%mod;
        else
            sumblue=(sumblue+sumred+1)%mod;
    }

    cout<<(sumred+sumblue)%mod<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define CLR(a) memset(a, 0, sizeof(a))
#define vl vector<ll>
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define MOD 1000000007
#define fi first
#define sec second
#define pb push_back
#define rep(a, b) for(a = 0; a < b; a++)
#define rep2(a, b) for(a = 1; a <= b; a++)
#define all(a) a.begin(), a.end()
#define pq priority_queue
#define vi vector<int>
#define vii vector<pair<int,int>>
#define pii pair<int,int>
#define endl "\n"
#define vpll vector< pair<pll,pll> >
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define oo return 0;

/*set reverse order set<ll, greater<ll> >
  priority queue reverse order priority_queue<ll, vector<ll>, greater<ll> > pq*/

ll mat[26][26];

int main()
{
   	ios_base::sync_with_stdio(false);
   	cin.tie(NULL);
	ll n, sum = 3;
	cin >> n;
	vector<ll> dp(n+1, 0);
	// dp[0] = 1;
	dp[1] = 1, dp[2] = 3;
	if(n == 1)
	{
		cout << 1 << endl;
		oo
	}
	if(n == 2)
	{
		cout << 3 << endl;
		oo
	}
	for(ll i = 3; i <= n; i++)
	{
		dp[i] += dp[i-1]+dp[i-2]+2;
		dp[i] %= MOD;
	}
	cout << dp[n] << endl;
 	oo
}

#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9+7;

int main() {
	int n;
	scanf("%d", &n);
	long long z=1;
	long long j = 2;
	long long count = 1;
	for (int i = 1; i < n; i++) {
		count%=mod;
		j%=mod;
		z%=mod;
		count+=j;
		j+=z;
		z=j-z;
		count%=mod;
		j%=mod;
		z%=mod;
	}
	count%=mod;
	printf("%lld", count);
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef pair<ll, ii> ipii;
typedef pair<ii, ll> piii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<ipii> vipii;
typedef vector<piii> vpiii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef map<ll, ll> mpii;
typedef unordered_map<ll, ll> umpii;

#define pb(v) push_back(v)
#define all(v) v.begin(), v.end()
#define upb(v, key) (upper_bound(all(v), key) - v.begin())
#define lob(v, key) (lower_bound(all(v), key) - v.begin())

ll inf = 1e9;
ll INF = inf * inf;
ll mod = 1e9 + 7;
double eps = 1e-9;
const ld pi = ld(3.1415926535897932384626433832795);
ll dr[] = {1, 0, -1, 0};
ll dc[] = {0, 1, 0, -1};

void mod_add(ll &a, ll b) {
  a += b;
  if(a >= mod) a -= mod;
}
void mod_sub(ll &a, ll b) {
  a -= b;
  if(a < 0) a += mod;
}
ll mod_pow(ll b, ll p) {
  ll res = 1;
  while(p) {
    if(p & 1) {
      res = res * b % mod;
    }
    p >>= 1;
    b = b * b % mod;
  }
  return res;
}

//only for variables and vectors;
template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}
template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)

#define start_routine clock_t begin = clock();
#define end_routine                                                 \
  clock_t end = clock();                                            \
  double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;       \
  cerr << "\nTime elapsed : " << elapsed_secs << " seconds\n";      \
  return 0;
/*...................................................*/

main() {
  start_routine
  // ios_base::sync_with_stdio(false), cin.tie(NULL);
  // freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);

  ll t = 1, n, m, i, j, k, q, u, v;
  // cin >> t;
  // ll tc = t;
  while (t--) {
    // cout << "Case #" << tc - t << ": ";
    cin >> n;
    ll a = 0, b = 0;
    for(i = 1; i <= n; i++) {
      a = (a + b + 1) % mod;
      swap(a, b);
    }
    cout << (a + b) % mod;
  }
  end_routine
}

#include<bits/stdc++.h>

using namespace std;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) (int)(x).size()
#define CLEAR(tab) memset(tab, 0, sizeof(tab))
#define REP(x, n) for(int x = 0; x < (n); x++)
#define FOR(x, b, e) for(int x = (b); x <= (e); x++)
#define FORD(x, b, e) for(int x = (b); x >= (e); x--)
#define VAR(v, n) __typeof(n) v = (n)
#define FOREACH(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define DEBUG(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)

typedef long long int LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

const int MXN = 1000010;
const int C = 262144;
const int INF = 1000000001;
const int MOD = 1000000007;

int D[MXN][2];
int n;

void test() {
    scanf("%d", &n);
    D[1][0] = 1;
    D[1][1] = 0;
    FOR(i, 2, n) {
        if(i % 2) {
            D[i][0] = (1 + D[i - 2][0] + D[i - 1][1]) % MOD;
            D[i][1] = D[i - 1][1];
        }
        else {
            D[i][0] = D[i - 1][0];
            D[i][1] = (1  + D[i - 2][1] + D[i - 1][0]) % MOD;
        }
    }
    printf("%d\n", (D[n][0] + D[n][1]) % MOD);
}

int main() {
	int te = 1;
//	scanf("%d", &te);
	while(te--)
		test();
	return 0;
}

//  KIRA :-
#include<bits/stdc++.h>
using namespace std;
#define Nitroboost  ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ll long long int
ll gcd(ll a,ll b) {
    return b==0?a:gcd(b,a%b);
}
ll lcm(ll a,ll b){
ll g=(a*b)/gcd(a,b);
return g;
}
const int N =998244353;
const int MOD = 1e9 + 7;
void swap(char *p,char *q){   char temp=*p ;  *p=*q; *q=temp; return;}
long long int powxy(long long int x, long long int y) { if (y == 0) return 1;if (y%2 == 1) return (x*powxy(x, y-1))%N;long long int t = powxy(x, y/2);return (t*t)%N;}

long long a[1000006];
long long b[1000006];
int main()
{
  int n,k;
  cin>>n;

  for(int i=1;i<1000006;i++)
  {
      if(i&1)
      a[i]=(b[i-1]+1)%MOD;
      else
      b[i]=(a[i-1]+1)%MOD;
      a[i]=(a[i]+a[i-1])%MOD;
      b[i]=(b[i]+b[i-1])%MOD;
  }
  cout<<(a[n]+b[n])%MOD;

  }

#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <iomanip>
#include <climits>
using namespace std;
typedef long long int ll;
#define MOD 1000000007
#define INF 1000000000000000000
#define endll "\n"
#define pb push_back
#define forn(i,n) for(i=0;i<n;i++)
#define forab(i,a,b) for(i=a;i<=b;i++)
#define vpll vector<pair<ll,ll>>
#define vvll vector<vector<ll>>
#define pll pair<ll,ll>
#define vll vector<ll>
#define ff first
#define ss second
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define test ll t;cin>>t; while(t--)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
void inout()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
#endif
}
int main()
{
  fast_io;
  inout();
  ll n,i;
  cin>>n;
  ll dp[n+1][2];
  dp[1][0]=0;
  dp[1][1]=1;
  for(i=2;i<=n;i++)
  {
    if(i%2==0)
      dp[i][0]=(dp[i-1][1]+dp[i-1][0]+1)%MOD,dp[i][1]=(dp[i-1][1])%MOD;
    else
      dp[i][1]=(dp[i-1][0]+dp[i-1][1]+1)%MOD,dp[i][0]=dp[i-1][0]%MOD;
  }
  cout<<(dp[n][0]+dp[n][1])%MOD<<endl;
  return 0;
}

#include <cstdio>
#include <memory.h>
#include <cstring>
#include <vector>
#include <deque>
#include <cstdlib>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <functional>
#include <set>
#include <list>
#include <map>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef unsigned long long llu;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
const ll MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;

int dp[1000000][2];
int n;

// 최근에 남긴 게 무슨 색이었는 지.
// 짝수라면 0, 홀수라면 1
int go(int o, int pre) {
	if (o == n) return 1;
	if (dp[o][pre] != -1) return dp[o][pre];

	int sum = 0;
	if (o % 2) {
		sum += go(o + 1, pre);
		if(pre == 0) sum += go(o + 1, pre ^ 1);
	}
	else {
		sum += go(o + 1, pre);
		if (pre) sum += go(o + 1, pre ^ 1);
	}

	return dp[o][pre] = sum % MOD;
}

int main() {
	scanf("%d", &n);
	memset(dp, -1, sizeof(dp));

	ll sum = go(0, 0) + go(0, 1) - 2;
	printf("%lld", (sum + MOD) % MOD);
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll a[1000005];

void sol()
{
    ll n,m,i,j,k;
    cin>>n;
    a[0]=1;
    a[1]=1;
    m=1000000007;
    for(i=2;i<=n;i++)
    {
        a[i]=a[i-1]+a[i-2];
        a[i]%=m;
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    ans+=a[i],ans%=m;
    cout<<ans;
}

int main() {
    // ll t;
    // cin>>t;
    // while(t--)
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    sol();
	return 0;
}

/*
In the name of god the beneficent the merciful
*
*
*
*/
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <cstdio>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <fstream>
#include <cstdio>
#include <queue>
#include <deque>
#include <cmath>
#include <string>
#include <cstring>
#define mk make_pair
#define ss second
#define ff first
#define pb push_back
#define real() X
#define imag() Y
using namespace std;

typedef long double ld;
typedef complex <ld> point;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn=1000*1000+100;
int n;
ll dp[maxn][3],inf=1000*1000*1000+7;
int main()
{
    ios_base::sync_with_stdio (false);
    //freopen ("inp.txt","r",stdin);
    //freopen ("out.txt","w",stdout);
    cin>>n;
    /*if(n==1)
    {
        cout<<"1"<<endl;
        return 0;
    }/*
    if(n==2)
    {
        cout<<"3"<<endl;
        return 0;
    }*/
    dp[1][1]=2;
    dp[1][2]=1;
    for(int i=2;i<=n;i++)
    {
        if(i%2==1)
        {
            dp[i][1]=(dp[i-1][1]+dp[i-1][2])%inf;
            dp[i][2]=dp[i-1][2];
        }
        else
        {
            dp[i][2]=(dp[i-1][1]+dp[i-1][2])%inf;
            dp[i][1]=dp[i-1][1];
        }
    }
    cout<<(dp[n][1]+dp[n][2]-2+inf)%inf<<endl;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n;
long long base=1e9+7,f[1000001];
int main(){
    cin>>n;
    f[1]=1;
    f[2]=3;
    for(int i=3;i<=n;i++){
        f[i]=((f[i-1]*2)-(f[i-3])+base)%base;
    }
    cout<<f[n]%base;
}

// http://codeforces.com/problemset/problem/209/A

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define eps 1e-10
#define fi first
#define se second
#define MOD1 1000000007LL
#define MOD 1000000009LL
#define p1 53
#define se second
#define inf 20000000000LL
#define pb push_back
#define mp make_pair
#define maxn 1000005

ll gcd1(ll a, ll b) {
    if (a == 0)
        return b;
    return gcd1(b % a, a);
}

ll modx(ll base, ll ex)
{
    ll ans = 1LL, val = base;
    while(ex > 0LL)
    {
        if(ex&1LL)
            ans = (ans*val)%MOD;
        val = (val*val)%MOD;
        ex = ex>>1LL;
    }
    return ans;
}

ll dp[maxn], odd[maxn], ev[maxn];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin >> n;

    dp[1] = odd[1] = 1;
    ll ans = 1;

    for (int i = 2; i <= n; i++) {
        if (i % 2) {
            dp[i] = (ev[i - 1] + 1) % MOD1;
            odd[i] = (odd[i - 2] + dp[i]) % MOD1;
        }
        else {
            dp[i] = (odd[i - 1] + 1) % MOD1;
            ev[i] = (ev[i - 2] + dp[i]) % MOD1;
        }
        ans = (ans + dp[i]) % MOD1;
    }

    cout << ans << endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;

// #define int long long

#define fs first
#define sc second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
#define pb push_back
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MP make_pair
#define sqr(x) ((x) * (x))
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MOD = 1e9 + 7;
const int N = 1e6 + 100;
int f[N];

signed main() {
	fastio;
	#ifdef FlameDragon
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif

	f[1] = f[2] = 1;
	for (int i = 3; i < N; i++) {
		f[i] = (f[i - 1] + f[i - 2]) % MOD;
	}
	int n;
	cin >> n;
	int ans = (f[n + 3] + MOD - 2) % MOD;
	cout << ans << '\n';
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <string>
#include <cstring>
#include <ctime>
#include <cassert>
#include <queue>
#include <stack>
#include <bitset>

using namespace std;

const long long MODULE = (long long)1e9 + 7LL;

int n, i, cr;
long long ans, f[2];

int main()
{
        //freopen("input.txt", "r", stdin);
        cin >> n;
        #define WHITE 0
        #define BLACK 1
        for (i = 1; i <= n; i++)
        {
                cr = i % 2;
                if (cr == WHITE)
                {
                        ans += (f[BLACK] + 1);
                        ans %= MODULE;
                        f[WHITE] += (f[BLACK] + 1);
                        f[WHITE] %= MODULE;
                }
                else
                {
                        ans += (f[WHITE] + 1);
                        ans %= MODULE;
                        f[BLACK] += (f[WHITE] + 1);
                        f[BLACK] %= MODULE;
                }
        }
        cout << (f[WHITE] + f[BLACK]) % MODULE << "\n";
        return 0;
}

// in the name of god :)

// Includes ans more :

#include <bits/stdc++.h>
using namespace std ;

// Defines :

#define endl '\n'
#define fi first
#define se second

// Constants :

const int maxn = 1e6 + 10 ;
const int Mod = 1e9 + 7 ;
const int maxL = 25 ;

// Global variables :

int n , dp[maxn] ;

// Fuctions :

// Main CODE :

int main() {
	ios_base::sync_with_stdio ( false ) ;
	int n ;
	cin >> n ;
	dp[1] = 1 ;
	dp[2] = 3 ;
	for ( int i = 3 ; i <= n ; i++ )
		dp[i] = ( ( ( 2 + dp[i-1] + dp[i-2] ) % Mod ) % Mod ) ;
	cout << dp[n] << endl ;
	return 0 ;
}

// The end !!!

#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define md 1000000007
int main()
{

    ll n;
    cin >> n;
    ll dp[n + 2];
    dp[1] = 1;
    dp[2] = 3;
    dp[3] = 6;
    for (int i = 4; i <= n; i++)
        dp[i] = (dp[i - 1] + dp[i - 2] + 2) % md;
    cout << dp[n] % md;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define str string
#define pb push_back
#define vc vector
#define ci cin
#define co cout
#define mod 1000000007

int main()
{
	 #ifndef ONLINE_JUDGE
	 freopen("input.txt","r",stdin);
	 freopen("output.txt","w",stdout);
	 freopen("error.txt","w",stderr);
    #endif

	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll x=0,y=0;
    for(int i=0;i<n;i++)
    {
    	if(i%2!=0)
    		x=(x+y+1)%mod;
    	else
    		y=(x+y+1)%mod;
    }
    cout<<(x+y)%mod;

}

////////////////<------------- Xorcestor_X -------------->////////////////
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#include <sstream>
#include <algorithm>
#include <map>
#include <iterator>
#include <queue>
#include <utility>
#include <set>
#include <deque>
#include <string>

using namespace std;
#define endl "\n"
#define ll long long int
#define c(x) ll x;cin>>x
#define cc(x,y) ll x,y;cin>>x>>y
#define ccc(x,y,z) ll x,y,z; cin>>x>>y>>z
#define db long double
#define fast cin.tie(NULL); cout.tie(NULL); ios_base::sync_with_stdio(false)
#define inf 1e16
#define mod 1000000007
#define mod2 998244353
#define eps 1e-7
#define PI 3.1415926535897932385
#define pb push_back
#define bitc  __builtin_popcountll
#define mp make_pair
#define ff first
#define ss second
#define all(ar) ar.begin(), ar.end()
#define len(x) (ll)(x).size()
#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define foreach(it,ar) for (auto it = ar.begin(); it != ar.end(); it++)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define print(arr,n) cout<<" :: "<<#arr<<" :: "<<endl; rep(i,n) cout<<arr[i]<<" "; cout<<endl
#define print2(arr,n,m) cout<<" :: "<<#arr<<" :: "<<endl; rep(i,n){ rep(j,m) cout<<arr[i][j]<<" "; cout<<endl; }
#define dyn1(arr,n) ll* arr=new ll[n]; rep(i,n) arr[i]=0;
#define dyn2(arr,n,m) ll** arr=new ll*[(n)]; rep(i,n) arr[i]=new ll[m]; rep(i,n) rep(j,m) arr[i][j]=0
#define carr(arr,n) fr(i,0,n-1) cin>>arr[i]
#define carr2(arr,n,m) fr(i,0,n-1) fr(j,0,m-1) cin>>arr[i][j]
#define debug(a) cout<<" :: "<<#a<<" == "<<a<<endl
#define debug2(a,b) cout<<" :: "<<#a<<" == "<<a<<" :: "<<#b<<" == "<<b<<endl
#define watch(x) cerr << (#x) << " is " << (x) << endl
#define debugx(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debugx("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
typedef pair<ll,ll> pii;
typedef vector<pii> vii;
const ll N = 105;
typedef ll mt[N][N];

inline ll maxim(ll a,ll b) {if(a>b) return a; else return b;}
inline ll minim(ll a,ll b) {if(a<b) return a; else return b;}
inline bool equals(double a, double b){ return fabs(a - b) < 1e-9; }
ll gcd(ll a, ll b) { return b==0 ? a : gcd(b, a%b); }

ll reduce(ll a,ll m)
{
  a%=m;
  a+=m;
  a%=m;
  return a;
}

ll Extended_gcd(ll a,ll b,ll& x,ll& y)
{
  if(a==0)
  {
    x=0;
    y=1;
    return b;
  }
  else
  {
    ll x1,y1;
    ll g=Extended_gcd(b%a,a,x1,y1);
    x=y1-(b/a)*x1;
    y=x1;
    return g;
  }
}

bool leap(ll y)
{
  if(y%400==0) return true;
  if((y%4==0)&&(y%100!=0)) return true;
  return false;
}

ll isprime(ll n)
{
  if(n==1) return false;
  if(n==2) return true;
  for(int i=2;i*i<=n;i++)
  {
    if(n%i==0) return false;
  }
  return true;
}

bool prime[2000010];
void SieveOfEratosthenes()
{
    memset(prime, true, sizeof(prime));
    prime[1]=false;
    for (int p=2; p*p<=2000001; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=2000001; i += p)
                prime[i] = false;
        }
    }
}

// vector<ll> prime_vec[1000010];
// void modified_SieveOfEratosthenes()
// {
//     //prime[1]=false;
//     for (int p=2; p*p<=1000001; p++)
//     {
//         if (prime_vec[p].size()==0)
//         {
//             for (int i=p*2; i<=1000001; i += p)
//                 prime_vec[i].pb(p);
//         }
//     }
// }

////*** Various Exponentiation Functions ***////

ll binpow(ll a, ll b)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1) res = (res * a);
        a = (a * a);
        b >>= 1;
    }
    return res;
}

// ll result[1000010];
// ll tempo[1000010];
// ll per[1000010];
//
//
// void permutation_exp(ll n,ll x)
// {
//   fr(o,1,n)
//   {
//     result[o]=o;
//   }
//
//   while(x>0)
//   {
//     if(x&1)
//     {
//       fr(o,1,n)
//       {
//         tempo[o]=result[o];
//       }
//
//       fr(o,1,n)
//       {
//         result[o]=tempo[per[o]];
//       }
//     }
//
//     fr(o,1,n)
//     {
//       tempo[o]=per[o];
//     }
//
//     fr(o,1,n)
//     {
//       per[o]=tempo[tempo[o]];
//     }
//     x>>=1;
//   }
// }

ll len;
ll ultimate[110][110];

void matrix_exp(ll arr[100][110],ll n)
{
  //ll len=4;
  ll res[110][110];
  rep(o,len)
  {
    rep(p,len)
    {
      if(o!=p)
      res[o][p]=0;
      else
      res[o][p]=1;
    }
  }

  ll temp[110][110];

  while(n)
  {
    if(n&1)
    {
      rep(x,len)
      {
        rep(y,len)
        {
          temp[x][y]=0;
        }
      }

      fr(i,0,len-1)
      {
        fr(j,0,len-1)
        {
          fr(z,0,len-1)
          {
            temp[i][j]+=reduce(res[i][z]*arr[z][j],mod);
          }
        }
      }

      fr(i,0,len-1)
      {
        fr(j,0,len-1)
        {
          res[i][j]=reduce(temp[i][j],mod);
        }
      }
    }

    rep(x,len)
    {
      rep(y,len)
      {
        temp[x][y]=0;
      }
    }

    fr(i,0,len-1)
    {
      fr(j,0,len-1)
      {
        fr(z,0,len-1)
        {
          temp[i][j]+=reduce(arr[i][z]*arr[z][j],mod);
          temp[i][j]%=mod;
        }
      }
    }

    fr(i,0,len-1)
    {
      fr(j,0,len-1)
      {
        arr[i][j]=reduce(temp[i][j],mod);
      }
    }

    n/=2;
  }

  fr(i,0,len-1)
  {
    fr(j,0,len-1)
    {
      ultimate[i][j]=reduce(res[i][j],mod);
    }
  }
}

ll modpow(ll a, ll b,ll x)
{
    ll res = 1;
    while (b > 0)
    {
        if (b & 1) res = (res * a)%x;
        a = (a * a)%x;
        b >>= 1;
    }
    return res;
}

////*** End of Various Exponentiation Functions ***////

int modInverse(int a, int m)
{
    int m0 = m;
    int y = 0, x = 1;
    if (m == 1)
      return 0;
    while (a > 1)
    {
        // q is quotient
        int q = a / m;
        int t = m;
        // m is remainder now, process same as
        // Euclid's algo
        m = a % m, a = t;
        t = y;
        // Update y and x
        y = x - q * y;
        x = t;
    }
    // Make x positive
    if (x < 0)
       x += m0;
    return x;
}

ll int_sqrt(ll h)
{
  ll g=(ll)sqrt(h);
  g++;
  if(g*g==h) return g;
  g--;
  if(g*g==h) return g;
  g--;
  if(g*g==h) return g;
  return -1;
}

ll lpf[1000001] = {};

void precompute()
{
  fr(i,2,1000000)
  {
    if(!lpf[i])
    {
      for(ll j=i;j<=1000000;j+=i)
      {
        if(!lpf[j])
        lpf[j]=i;
      }
    }
  }
}

ll fact[2000010];

void compute_fact()
{
  fact[0]=1;
  fr(o,1,2000004)
  {
    fact[o]=(fact[o-1]*o)%mod;
  }
}

ll ncr_mod(ll n,ll r)
{
  if(r==0||n==r) return 1;
  else return (((fact[n]*modInverse(fact[r],mod))%mod)*modInverse(fact[n-r],mod))%mod;
}

ll f(ll x)
{
  ll total=0;
  return total;
}

ll ternary_search(ll l, ll r)
{              //set the error limit here
    while (r - l > 10)
    {
        ll m1 = l + (r - l) / 3;
        ll m2 = r - (r - l) / 3;
        ll f1 = f(m1);      //evaluates the function at m1
        ll f2 = f(m2);      //evaluates the function at m2
        if (f1 > f2)
            l = m1;
        else
            r = m2;
    }
    ll mino=f(l);
    ll mino_x=l;

    fr(o,l,r)
    {
      if(f(o)<mino)
      {
        mino_x=o;
        mino=f(o);
      }
    }
    return f(mino_x);
}

// ll tree[2000010];
// void build(ll* a,ll v,ll tl,ll tr)
// {
//   if(tl==tr)
//   {
//     tree[v]=((a[tl]==x)?1:0);
//   }
//   else
//   {
//     ll tm=(tl+tr)/2;
//     build(a,v*2,tl,tm);
//     build(a,v*2+1,tm+1,tr);
//     tree[v]=tree[v*2]+tree[v*2+1];
//   }
// }
//
// ll query(ll v,ll tl,ll tr,ll l,ll r)
// {
//   if(l>r) return 0;
//   if(l==tl&&r==tr) return tree[v];
//   ll tm=(tl+tr)/2;
//   return query(v*2,tl,tm,l,minim(r,tm))+query(v*2+1,tm+1,tr,maxim(l,tm+1),r);
// }
//
//
// void update(ll v,ll tl,ll tr,ll pos,ll new_val)
// {
//   if(tl==tr)
//   {
//     tree[v]=((arr[pos]==x)?1:0);
//   }
//   else
//   {
//     ll tm=(tl+tr)/2;
//     if(pos<=tm) update(v*2,tl,tm,pos,new_val);
//     else update(v*2+1,tm+1,tr,pos,new_val);
//     tree[v]=tree[v*2]+tree[v*2+1];
//   }
// }
//
//
// ll find_kth(ll v,ll tl,ll tr,ll k)
// {
//   if(k>tree[v]) return -1;
//   if(tl==tr) return tl;
//   ll tm=(tl+tr)/2;
//   if(tree[v*2]>=k) return find_kth(v*2,tl,tm,k);
//   else return find_kth(v*2+1,tm+1,tr,k-tree[v*2]);
// }

ll far[1000010];
ll farsum[1000010];

ll func(ll x)
{
  return (x*(x+1))/2;
}

ll bs(ll low,ll high,ll target)
{
  while(low+4<high)
  {
    ll mid=(low+high)/2;
    //increasing function with inclusion
    if(func(mid)<target)
    {
      low=mid;
    }
    else
    {
      high=mid-1;
    }
  }

  frr(o,high,low)
  {
    if(func(o)<target) return o;
  }

  return -1;
}

ll lpfx(ll x)
{
  if(x%2==0) return 2;
  else
  {
    for(int z=3;z*z<=x;z+=2)
    {
      if(x%z==0) return z;
    }
  }
  return x;
}

ll fz(ll n)
{
  ll o=1;
  while(o<=n)
  {
    o*=2;
  }
  return o;
}

ll red[1000010];
ll blue[1000010];

int main()
{
  fast;

  #ifndef ONLINE_JUDGE
  // for getting input from input.txt
  freopen("input.txt", "r", stdin);
  // for writing output to output.txt
  freopen("output.txt", "w", stdout);
  #endif

  c(n);
  red[0]=1;
  blue[0]=0;
  fr(o,1,n-1)
  {
    if(o%2==0)
    {
      red[o]=red[o-1]+blue[o-1]+1;
      red[o]%=mod;
      blue[o]=blue[o-1];
    }
    else
    {
      blue[o]=blue[o-1]+red[o-1]+1;
      blue[o]%=mod;
      red[o]=red[o-1];
    }
  }
  cout<<(blue[n-1]+red[n-1])%mod<<endl;

  return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define int long long

const int MaxN=1E6+10;
const int MOD=1000*1000*1000+7;
int dp[MaxN];

int32_t main(){
	int n;
	cin >> n;
	dp[1]=1;
	dp[2]=3;
	for(int i=3;i<=n;++i){
		dp[i]=dp[i-1]+dp[i-2]+2;
		dp[i]%=MOD;
	}
	cout << dp[n];
}

#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 100, MOD = 1000 * 1000 * 1000 + 7;

inline int sum(int a, int b) {
	a += b;
	if(a >= MOD)
		a -= MOD;
	return a;
}

int fibo(int dex) {
	int a = 1, b = 1, c;
	dex --;
	while(dex--) {
		c = sum(a, b);
		a = b, b = c;
	}
	return b;
}

int n;

int main() {// 1 base
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n;
	cout << sum(fibo(n + 2), MOD - 2);
	return 0;
}

#include <bits/stdc++.h>
#define li long long int
#define mod 1000000007
using namespace std;
int main() {
    int n;
    cin>>n;
    int ans[n+1];
    ans[1]=1;
    ans[2]=3;
    for(int i=3;i<=n;i++){
        ans[i]=(ans[i-1]+ans[i-2]+2)%mod;
    }
    cout<<ans[n];
}

#include <iostream>
const int MOD = 1000000007;
using namespace std;
int main(){
    int n;
    cin >> n;
    int f[n + 1];
    f[0] = 1;
    f[1] = 2;
    for(int i = 2; i <= n; i++){
        f[i] = f[i - 1] + f[i - 2];
        f[i] %= MOD;
    }
    int cntr = 0;
    for(int i = 0; i < n; i++){
        cntr += f[i];
        cntr %= MOD;
    }
    cout << cntr << endl;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll dp[2000000];
ll bg = 1000000007;
int main()
{
    ll n,i,j,m,k,t;
    cin>>n;
    dp[1]=1;
    for(i=2;i<=n;i++)
      dp[i] = (((dp[i-1]+dp[i-2]))%bg+2)%bg;
    cout<<dp[n];
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(a,b,c) for(int a=b; a<c; a++)
#define pb push_back
int main()
{
    int n;
    cin>>n;
    ll mod=1e9+7;
    ll dp[n];
    memset(dp,0,sizeof dp);
    dp[0]=1;
    dp[1]=2;
    fr(i,2,n)
    {
        dp[i]=(dp[i-1]+dp[i-2]+1)%mod;
    }
    if(n<=1)
    {
        cout<<dp[0]<<endl;
    }
    else
    cout<<(dp[n-1]+dp[n-2])%mod<<endl;

}

   /* AUTHOR : RAIYAN MAHIN */
#include<bits/stdc++.h>
#include<stdio.h>
#include <iostream>
#include <stdlib.h>
#define endl "\n"
//#define long long LL
const int MAX=2e5+7;
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
        long long n;
         cin>>n;
        long long a[n+5];
         a[0]=0;
         a[1]=1;
         for(long long i=2; i<=n+5; i++)
            a[i]=(a[i-1]+a[i-2]+2) % 1000000007;
         return cout<<a[n]<<endl,0;
     }

    //Catchharsh
    //I Luv Kunj017
    #include<bits/stdc++.h>
    #define ll long long int
    #define ld long double
    #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define F first
    #define S second
    #define pb push_back
    #define endl '\n'
    const ll MOD = 1e9+7;
    const ll INF = 1011111111;
    const ll LLINF = 1000111000111000111LL;
    const ld EPS = 1e-10;
    const ld PI = 3.14159265358979323;
    using namespace std;
    ll power (ll x,ll n)
    {
        if(n==0)
        return 1;
        else if(n%2==0)
        return power((x*x),n/2);
        else
        return x*power((x*x),(n-1)/2);
    }
    int main()
    {
         IOS;
         ll n,m,i,j,k;
         cin>>n;
         if(n==1)
          return cout<<1,0;
         ll cum[n]={0};
         ll dp[n+1]={0};
         cum[0]=1;
         dp[0]=1;
         dp[1]=2;
         cum[1]=2;
         ll ans=3;
         for(i=2;i<n;i++)
         {
            dp[i]=cum[i-1]+1;
            dp[i]%=MOD;
            cum[i]=dp[i]+cum[i-2];
            cum[i]%=MOD;
            ans+=dp[i];
            ans%=MOD;
         }
         cout<<ans;
    }

#include <cstdio>
using namespace std;

const int INF = 1000000007;

int main(){
    int n,dp[2]={1,1};
    scanf("%d",&n);
    for(int i=0;i<n;i++) dp[i&1]=(dp[i&1]+dp[~i&1])%INF;
    printf("%d\n",((dp[0]+dp[1])%INF+INF-2)%INF);
}

//lxrtxdy!
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
// #define md 1e9 + 7
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define ff first
#define ss second

using namespace std;

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt","w", stdout);
	#endif

	ll int  n;
	cin>>n;

	ll int dp1[n+1],dp2[n+1];
	memset(dp1,0,sizeof(dp1));
	memset(dp2,0,sizeof(dp2));

	dp1[1]=1;
	dp1[2]=2;

	dp2[1]=1;
	dp2[2]=2;

	if(n==1)
	{
		cout<<dp1[1];
		return 0;
	}
	if(n==2)
	{
		cout<<3;
		return 0;
	}

	ll int md = 1000000007;

	ll int ans=0;

	ans=3;

	for(ll int i=3;i<=n;i++)
	{
		dp1[i] = dp2[i-1]+1;
		dp2[i] = dp2[i-2] + dp1[i];
		dp1[i]%=md;
		dp2[i]%=md;

		ans+=dp1[i];

		ans%=md;
	}

	cout<<ans<<endl;

	return 0;
}

//orzlxr!//hello

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
int main()
{
	vector<int> v;
	vector<int> s;
	v.push_back(1);v.push_back(2);s.push_back(0);s.push_back(1);
	for(int i=0;i<1000002;i++)
		v.push_back((v[i]+v[i+1])%1000000007);
	for(int i=1;i<1000002;i++)
		s.push_back((s[i]+v[i])%1000000007);
	for(int n;cin>>n;)
		cout<<s[n]<<endl;
}

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int n;

int main(){
    ios::sync_with_stdio(false);
    cin>>n;

    vector <int> niep(n+1, 0);
    vector <int> parz(n+1, 0);
    niep[1] = 1;

    for(int i = 2; i<=n; i++){
    niep[i] = niep[i-1];
        parz[i] = parz[i-1];
        if(i % 2 == 0){
            parz[i] += niep[i-1] + 1;
            parz[i] %= 1000000007;
        }
        else{
            niep[i] += parz[i-1] + 1;
            niep[i] %= 1000000007;
        }
    }
    cout << (parz[n] + niep[n]) % 1000000007;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <string>
#include <set>
using namespace std ;
typedef long long ll ;
int main()
{
    int n ;
    scanf("%d" , &n) ;
    int a=1,b=2,c;
    for(int i = 0 ; i < n ; i++)
    {
        c = (a+b)%1000000007 ;
        a = b ;
        b = c ;
    }
    printf("%d\n", c-2);
    return 0 ;
}

#include <bits/stdc++.h>
#define I int64_t
using namespace std;
int M = 1e9+7;

int main() {

    //freopen("in.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> dp(max(n+1, 3), 0);
    vector<int> sum(max(n+1, 3), 0);

    dp[1]=1;
    dp[2]=3;
    sum[1]=1;
    sum[2]=3;

    for (int i=3; i<= n; i++) {
        dp[i] = i;
        //for (int j = 1; (2 * j - 1) <= i; j++)
        dp[i] = (dp[i] + sum[i-1]) % M;
        sum[i] = (sum[i-2] + dp[i]) % M;
    }
    cout << dp[n] << endl;

}

#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define mx 1000000007

ll flag[1000007];
//ll sum[1000007];

int main()
{
    ll n;
    cin>>n;
    if(n==1)
    {
        cout<<"1";
        return 0;
    }
    else if(n==2)
    {
        cout<<"3";
        return 0;
    }
    flag[1]=1;
    flag[2]=2;
    //sum[1]=1;
    //sum[2]=2;
    ll odd=1,even=2,ans=3;
    for(ll i=3;i<=n;i++)
    {
        if(i&1)
        {
            flag[i]=(even+1)%mx;
            //flag[i]%=mx;
            odd+=flag[i];
            odd%=mx;
        }
        else
        {
            flag[i]=(odd+1)%mx;
            //flag[i]%=mx;
            even+=flag[i];
            even%=mx;
        }
        ans+=flag[i];
        ans%=mx;
    }
    cout<<ans;
}

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define int long long int
#define float long double
vector <int> f(1000002,0);
vector <int> sum(1000002,0);
int mod=1e9+7;
void solve()
{
      int n=0;
      cin>>n;
      int ans=sum[n+1]-1;
      cout<<ans<<"\n";
      return;
}
signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(0);
      cout.tie(0);
      int t;
      //cin>>t;
      t=1;
      f[1]=1;
      sum[1]=1;
      for(int i=2;i<=1e6+1;i++)
      {
            f[i]=f[i-1]+f[i-2];
            f[i]=f[i]%mod;
            sum[i]=sum[i-1]+f[i];
            sum[i]=sum[i]%mod;
      }
      while(t--)
      {
            solve();
      }
      return 0;
}

#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define forr(i,n) for(ll i=0;i<n;i++)
#define fastio ios_base::sync_with_stdio(false); cin.tie(0) ; cout.tie(0);
#define sortt(x) sort(x.begin(),x.end())
#define sortr(x) sort(x.rbegin(),x.rend())
#define eb emplace_back
#define take(x) ll x; cin >> x
#define vect(x) vector<x>
using namespace std;

ll add(ll a, ll b) { a%=mod; b%=mod; return (a+b + mod)%mod;}
ll mul(ll a, ll b) { a%=mod; b%=mod; return (a*b + mod)%mod;}

ll power(ll x, ll n){ if(n==0 || x==1) return 1; ll ans = power(x,n/2) % mod;
    if(n&1) return (((ans*ans)%mod)*(x%mod))%mod; else return ((ans*ans)%mod);}

void solve()
{
    ll n;
    cin >> n;
    if(n==1) cout << 1;
    else if(n==2) cout << 3;
    else
    {
        ll a = 1 , b = 2 , temp;
        for(ll i=0;i<n-2;i++)
        {
            temp = b;
            b = (a+b+1)%mod;
            a = temp;
        }
        cout << add(a,b);
    }

    return;
}

int main()
{

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    fastio

    solve();

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define MOD 1000000007
#define MODO 1000002
#define INF 1000000
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define sld(t) scanf("%ld",&t)
#define pd(t) printf("%d\n",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pp pair<ll,int>
#define pll pair<ll,ll>
#define mp(a,b) make_pair(a,b)
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define pb(x) push_back(x)
#define MAX 1000007
#define one 1LL

ll dp[MAX];

int main() {
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	int n;
	cin>>n;

	ll r = 1LL; ll b = 0LL;
	dp[1] = 1;
	for( int i=2; i<=n; i++) {
		if(i%2==0) {
			// blue comes here
			dp[i] = 1 + dp[i-1] + r;
			b += 1 + r;
		}
		else {
			// red comes here
			dp[i] = 1 + dp[i-1] + b;
			r += 1 + b;
		}
		dp[i] %= MOD;
		r %= MOD;
		b %= MOD;
	}
	cout<<dp[n]<<endl;
	return 0;
}

#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
#define FOR(i,n) for(i=0;i<(n);i++)
#define CLR(a) memset(a,0,sizeof(a))
#define CIN(a) scanf("%d",&a)
typedef long long ll;
using namespace std;
int main()
{
    int n,i;
    int MOD=1000000007;
    while(scanf("%d",&n)!=EOF){
        ll ans=0;
        ll a0=0,a1=0;
        for(i=0;i<n;i++){
            if(i%2){
                ans=(ans+(a0+1))%MOD;
                a1=(a1+a0+1)%MOD;
            }else{
                ans=(ans+(a1+1))%MOD;
                a0=(a0+a1+1)%MOD;
            }
        }
        printf("%I64d\n",ans);
    }
    return 0;
}

#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<ctype.h>    //tower()
#include<set>
#include<map>
#include<iomanip>// cout<<setprecision(1)<<fixed<<a;
#include<vector>
#include<time.h>
#include<assert.h>  //assert
#include<cmath>
#include<algorithm>
#include<bitset>
#include<limits.h>
#include<stack>
#include<queue>
using namespace std;
const int maxn=100010;
const int maxm=1001;
const int inf=INT_MAX;

const int m = 1000000007;

int main(){
	int n;
	while(~scanf("%d",&n)){
		int ways[2],ans = 0;
		ways[0] = ways[1] = 0;
		for(int i = 0,p = 0;i < n;++i,p ^= 1){
		    int cur = 1 + ways[p ^ 1];
		    ans = (ans + cur) % m;
		    ways[p] = (ways[p] + cur) % m;
		}
		printf("%d\n",ans);
	}
	return 0;
}

#include<iostream>
#include<vector>

using namespace std;

const int MOD = 1000 * 1000 * 1000 + 7;

int main()
{
	int n;
	cin >> n;
	vector<pair<int, int>> dp(1 + n, { 0, 0 });
	/// dp[i] - ���-�� ���������������������� �� �������� ����� i �������������� �� {������� ����, ����� ����}.
	dp[0] = { 1, 1 };
	for (int i = 1; i <= n; ++i) {
		if (i % 2 == 0) {
			dp[i].first = (dp[i - 1].first + dp[i - 1].second) % MOD;
			dp[i].second = dp[i - 1].second;
		}
		else {
			dp[i].first = dp[i - 1].first;
			dp[i].second = (dp[i - 1].first + dp[i - 1].second) % MOD;
		}
	}
	cout << (1LL * dp[n].first + dp[n].second + MOD - 2) % MOD  << endl;
	return 0;
}

#include <bits/stdc++.h>
#define ii       pair <int,int>
#define mod      1000000007
#define vi       vector <int>
#define pb       push_back
#define int      long long int
#define Raag4924 ios_base::sync_with_stdio(false);
#define fastio   cin.tie(NULL);cout.tie(NULL);
#define all(x)   x.begin(),x.end()
#define f        first
#define se       second
using namespace std;
vi fact(1000007);
inline int mdpower(int a,int b)
{
    int res =1;
    while(b)
    {
        if(b&1) res = (res%mod*a%mod)%mod;
        b/=2;
        a = (a%mod*a%mod)%mod;
    }
    return res;
}
inline int power(int a,int b)
{
    int res =1;
    while(b)
    {
        if(b&1) res = (res*a);
        b/=2;
        a = a*a;
    }
    return res;
}
inline void factorial()
{
    fact[0]=1;
    for(int i=1;i<1000007;i++)
        fact[i] = (fact[i-1]%mod*i%mod)%mod;
}

inline int inverse(int a)
{
    return mdpower(a,mod-2);
}

 signed main()
 {
     Raag4924
     fastio

     #ifndef ONLINE_JUDGE
         freopen("input.txt","r",stdin);
         freopen("output.txt","w",stdout);
     #endif

         int n;
         cin>>n;
         if(n<=1)
         {
            cout<<n<<"\n";
            return 0;
         }
         else if(n==2)
         {
            cout<<"3\n";
            return 0;
         }
         int dp[n+1];

         memset(dp,0,sizeof dp);

        dp[1] = 1;
        dp[2] = 2;
        int sum=3;
        for(int i=3;i<=n;i++)
        {
            dp[i] = (dp[i-1]%mod+dp[i-2]%mod)%mod;
            sum = (sum%mod+dp[i]%mod)%mod;
        }

        cout<<sum<<"\n";
 }

#include <bits/stdc++.h>
//#include "util.h"
using namespace std;

#define sz(x) (int)(x).size()
#define F first
#define S second
#define mpa make_pair
#define pb emplace_back
#define int long long

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector< pii > vii;
typedef vector< vi > vvi;

template<typename c> void smax(c &x, c y) { x = max(x, y); }
template<typename c> void smin(c &x, c y) { x = min(x, y); }

const int maxn = 1e6 + 11;
const int mod = 1e9 + 7;
int dp[maxn][2];
int n;
int32_t main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n;
	dp[0][0] = 1;
	for (int i = 1; i < n; i++) {
		dp[i][0] = dp[i-1][0];
		dp[i][1] = dp[i-1][1];
		dp[i][i&1] += dp[i-1][ (i&1)^1 ] + 1;
		dp[i][0] %= mod;
		dp[i][1] %= mod;
	}

	cout << (dp[n-1][0] + dp[n-1][1]) % mod << endl;
	return 0;
}

#include <iostream>

using namespace std;
long long fib[1000000];
long long dp[1000000];
int main()
{
    int n;
    cin>>n;
    fib[0]=fib[1]=1;
    for(int i=2;i<=n;i++){
        fib[i]=fib[i-1]+fib[i-2];
    }
    dp[1]=1;
    for(int i=2;i<=n;i++){
        dp[i]=dp[i-1]+fib[i];
    }
    cout<<dp[n];
    return 0;
}

#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e6 + 5;
constexpr int mod = 1e9 + 7;

int n;
int cache[2][N];

int dp(int k, int x) {
    if (k == n) return 1;

    int &rv = cache[x][k];
    if (~rv) return rv;
    rv = 0;
    if (k % 2 == x) rv += dp(k + 1, x ^ 1);
    rv += dp(k + 1, x);
    rv %= mod;
    return rv;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);

    memset(cache, -1, sizeof cache);
    cin >> n;

    int ans1 = dp(0, 0);
    int ans2 = dp(0, 1);

    cout << (ans1 + ans2 - 2 + mod) % mod<< endl;
}

 #include <bits/stdc++.h>
	 using namespace std;

	#define fast ios_base::sync_with_stdio(0);cin.tie(0);
	#define LL long long int
	#define pb push_back
	#define mp make_pair
	#define PII pair<int,int>
	#define PLL pair<LL,LL>
	#define PIS pair< int,string>

	#define VI vector <int>::iterator it;
	#define VL vector <LL>::iterator lt;
	#define VPI vector <PII>::iterator pit;
	#define VPL vector <PLL>::iterator plt;

	#define test int t;cin>>t;while(t--)
	#define ff first
	#define ss second
	//#define N 1000000
	#define INF 1000000000
	#define INIT(a,x) memset(a,x,sizeof(a))
	#define input(a,n) for(i=0;i<n;i++)cin>>a[i];
	#define output(a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";
	const int N=1234567;
	int m=1000000007;
	int a[N];
	 int main()
	 {
	 	fast;
	 	LL i,n;

	 	cin>>n;
	 	a[1]=1;
	 	a[2]=3;
	 	for(i=3;i<=1000000;i++)
	 	{
	 		a[i]=(a[i-1]%m+(((i-1)*2)-1)%m)%m;
	 	}
	 	cout<<a[n];
	    return 0;
    }

#include <cmath>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<cctype>
#include <iomanip>
#include <string>
#include <sstream>

#include <functional>
#include <numeric>
#include <stack>
#include <climits>
#include <float.h>
#include<unordered_map>
#include <bitset>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define f(i,a,b) for(int i=a;i<b;i++)
#define F(i,a,b) for(int i=a;i>=    b;i--)
#define sz(a) ((int)a.size())
#define all(c) c.begin(), c.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl
#define sz(a) ((int)a.size())

//#define fast ios_base::sync_with_stdio(0);cin.tie(0) ;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;

typedef vector<pair<int, int> > vpii;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef long double ld;

template <class T> const T& max(const T& a, const T&b, const T&c) { return max(a, max(b, c)); }

template <class T> const T& min(const T& a, const T&b, const T&c) { return min(a, min(b, c)); }

void sc(int &a) { scanf("%d", &a); }void sc(ll &a) { scanf("%lld", &a); }void sc(int& a, int& b) { sc(a); sc(b); }
void sc(ll &a, ll &b) { sc(a); sc(b); }void sc(int& a, int& b, int& c) { sc(a, b); sc(c); }void sc(ll& a, ll& b, ll& c) { sc(a, b); sc(c); }
void prl(int a) { printf("%d\n", a); }void prl(ll a) { printf("%lld\n", a); }void prl() { printf("\n"); }
void prs(int a) { printf("%d ", a); }void prs(ll a) { printf("%lld ", a); }

ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }

ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

ll poww(ll a, ll b) {

	if (b == 0) return 1;

	ll tmp = poww(a, b / 2);

	return (b & 1 ? a * tmp * tmp : tmp * tmp);

}

ll sumOfDigs(string s) { ll sum = 0; for (int i = 0; i < s.length(); i++) sum += s[i] - '0'; return sum; }

ll sumOfDigs(ll n) { return (n < 10 ? n : n % 10 + sumOfDigs(n / 10)); }

string itos(ll i) { string s = ""; 	while (i) { s += char(i % 10 + '0'); i /= 10; } reverse(all(s));  return s; }

ll stoi(string &s) { ll tot = 0; for (int i = (int)s.length() - 1, j = 1; i >= 0; i--, j *= 10) { tot += j * (s[i] + '0'); }  return tot; }

int months[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

using namespace std;

#define PI acos((ld)-1.0)

// printf("%.8lf\n", sum * 1.0 / n);  // precision setting

ll mod = 1e9 + 7;

void tt() {

#ifndef online	_judge
	freopen("test.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

#endif
}

ll modpower(ll x, ll y, ll p)
{

	x %= mod;

	if (!y) return 1;

	ll res = 1;

	if (y & 1) { res *= x;  res %= p; }

	ll z = modpower(x, y / 2, p);

	z %= p;

	z *= z;

	z %= mod;

	res *= z;

	res %= p;

	return res;

}

ll  dp[1000 * 1000 + 10];

ll dfs(int i) {

	if (i <= 0) { return  0;  }

	if (i == 1) { return 1;  }

	if (dp[i] != -1) { return dp[i]; }

	ll res = 1;

	int  j = i;

	j -= 1;

	while (j > 0 ) {

		res += dfs(j);

		j -= 2;

	}

	dp[i] = res;

	return res;

}

int main() {

	int n;
	cin >> n;

	memset(dp, -1, sizeof(dp));

	ll tot = 0;

	for (int i = 1; i <= n; i++) tot += dfs(i);

	cout << tot << endl;

	return  0;

}

/*************************************************************************
Author: ziki
Created Time: 2012-7-28 14:06:28
File Name: A.cpp
Description:
************************************************************************/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <string.h>

using namespace std;

typedef long long int64;
typedef unsigned long long uint64;
#define two(X) (1<<(X))
#define twoL(X) (((int64)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)
const double pi=acos(-1.0);
const double eps=1e-11;
const int inf=0x7FFFFFFF;
template<class T> inline void checkmin(T &a,T b){if(b<a) a=b;}
template<class T> inline void checkmax(T &a,T b){if(b>a) a=b;}
template<class T> inline T sqr(T x){return x*x;}
typedef pair<int,int> ipair;
#define SIZE(A) ((int)A.size())
#define LENGTH(A) ((int)A.length())
#define MP(A,B) make_pair(A,B)
#define PB(X) push_back(X)
#define zero(a) memset(a, 0, sizeof(a))
#define out(x) (cout<<#x<<": "<<x<<endl)
template<class T>void show(T a, int n){for(int i=0; i<n; ++i) cout<<a[i]<<' '; cout<<endl;}
template<class T>void show(T a, int r, int l){for(int i=0; i<r; ++i)show(a[i],l);cout<<endl;}

int64 dp[1000005][2];
const int64 mod = 1000000007;
int main()

{
	int n;
	while(cin>>n)
	{
		//dp[0][0] = 1;
		for(int i=1; i<=n; i++)
		{
			if(i&1){
				dp[i][0] = dp[i-1][0]%mod;
				dp[i][1] = (dp[i-1][1] + dp[i-1][0] + 1)%mod;
			}
			else{
				dp[i][1] = dp[i-1][1] % mod;
				dp[i][0] = (dp[i-1][1] + dp[i-1][0] + 1)%mod;
			}
		}
		//for(int i=0; i<=n; i++)
		//	cout<<dp[i][0] <<' '<< dp[i][1]<<"  ";
		//cout<<endl;
		cout<<dp[n][0]+dp[n][1]<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define forr(i, a, b) for(int i=a; i<(b); i++)
#define forn(i, n) forr(i, 0, n)
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

const int MOD = 1000000007;

int main(){FIN;
	int n;
	int f[2], fib;
	f[0] = 0;
	f[1] = 1;
	cin >> n;
	forr(i, 2, n+4){
		int r = i%2;
		f[r] += f[1-r];
		fib = f[r]%MOD;
	}
	fib -= 2;
	fib = ((fib%MOD)+MOD)%MOD;
	cout << fib << "\n";
	return 0;
}

// read the question correctly (ll vs int)

#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

#define LL long long
#define mod 1000000007

int dp[1000006];
int main() {
    LL n;
    int i,j,k,l;
    dp[1] = 1;
    dp[2] = 3;
    for(int i = 3 ; i <= 1000000 ; i ++) {
        dp[i] = (dp[i - 1] + dp[i - 2] + 2) % mod;
    }
    while(~scanf("%d",&n)) {
        cout<<dp[i]<<endl;
    }
}

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    long n;cin>>n;
    long dp[n+1]={0};
    dp[1]=1;
    dp[2]=2;
    for(int i=3;i<=n;i++){
        dp[i]=(dp[i-1]+dp[i-2])%mod;
    }
    for(int i=2;i<=n;i++){
        dp[i]+=dp[i-1];
        dp[i]%mod;
    }
    cout<<dp[n];

}

#include<bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long int ll;
double PI=4.00*(atan(1));
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    if(n==1)
    {
        cout<<"1";
        exit(0);
    }
    if(n==2)
    {
        cout<<"3";
        exit(0);
    }
    ll init=1,temp;
    ll final=2;
    ll ans=3;
    n-=2;
    for(ll i=1;i<=n;i++)
    {
        temp=final;
        final=(final+init)%MOD;
        init=temp;
        ans=(ans+final)%MOD;
    }
    cout<<ans;
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long, long long>
#define f first
#define s second
#define debug cout<<"here\n"
#define MOD 1000000007

using namespace std;

void solve(){

	int n; cin>>n;
	ll a=0, b=1, ans=1;
	for(int i=1; i<n; i++){
		if(i%2) a += b;
		else b += a;
		ans += a+b;
	}
	cout<<ans;

}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout<<fixed<<setprecision(12);

	int t =1; //cin>>t;
	for(int i=1; i<= t; i++){
		solve();
		cout<<"\n";
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define MAXN 2000005
void solve() {
    int n,o=0,e=0;
    cin>>n;
    int dp[n];
    dp[0]=1;dp[1]=3;
    o=1;e=3;
    for(int i=2;i<n;i++){
        dp[i]=(dp[i-1]+abs(o-e)+1)%mod;
        if(i%2==0)o=(o+dp[i]);
        else e=(e+dp[i]);
    }
    cout<<dp[n-1]<<endl;
}
int32_t main() {
	int t=1;
// 	cin>>t;
while(t--){
// cout<<"Case"<<t<<endl;
solve();
}
	return 0;
}

#include<iostream>
using namespace std;
long long n,a,b,i,k,m=1e9+7;
int main(){
    cin>>n;a=1,b=0;
    for(i=1;i<=n;++i){
        k+=a+b;
        if(i&1)b+=a;
        else a+=b;
        k%=m;
    }
    cout<<k<<'\n';
}

#include <bits/stdc++.h>
using namespace std;

long long n, f[1000001], last, mod=1e9+7;

int main(){
	cin>>n;

	f[1]=1;
	f[2]=2;
	last=3;
	for(long long i=3; i<=n; i++){
		f[i]=f[i-1]+f[i-2];
		f[i]%=mod;
		last+=f[i];
		last%=mod;
	}

	if(n>2) cout<<last<<endl;
	else cout<<f[n]<<endl;
}

#include<bits/stdc++.h>
#define ll           long long
#define ld           long double
#define vi           vector<ll>
#define pii          pair<ll,ll>
#define vpii         vector<pii>
#define msi          map<string,ll>
#define pb           push_back
#define all(a)       (a).begin(),(a).end()
#define F            first
#define S            second
#define sz(x)        (int)x.size()
#define hell         1000000007
#define endl         '\n'
#define rep(z,a,b)   for(ll z=a;z<b;z++)
#define f(i,a,b)	   for(int i=a;i<=b;i++)
#define bs           binary_search
#define speed        ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define ubnd         upper_bound
#define lbnd         lower_bound
#define debug(x)     cerr << #x << " is " << x << endl
#define N            100000000
using namespace std;
//=====================

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }

void solve()
{
    ll n;
    cin>>n;
    ll dp[n+3];
    dp[1]=1;dp[2]=3;dp[3]=6;
    rep(i,4,n) dp[i]=((2*dp[i-1])%hell-dp[i-3]+hell)%hell;
    cout<<dp[n];
}
int main()
{
    speed;
    ll TESTS=1;
    //cin>>TESTS;
    while(TESTS--)
    {
        solve();
    }
    return 0;
}

#include <iostream>
#include <string>
#include <cstdio>
#include <memory.h>
#include <algorithm>
using namespace std;

const int MAXN = 1000000;
const long long MOD = 1000000007;
int n;
long long f[MAXN+1];

int main(){
	f[0] = 0;
	f[1] = 1;
	f[2] = 3;
	f[3] = 6;
	f[4] = 11;
	long long sum;
	for (int i=5;i<=MAXN;i++){
		int t = (i-1)/2;
		if (i%2 == 0) sum = t*t;
		else sum = t*(t-1);
		f[i] = f[i-1] + i + sum;
		f[i] %= MOD;
	}
	while (scanf("%d",&n) != EOF){
		printf("%lld\n",f[n]);
	}
	return 0;
}

#include<bits/stdc++.h>
#include<iomanip>
using namespace std;

#define fst first
#define snd second
#define mk make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

void solve(){
  ll n, dp[1000010], red = 1, blue = 2, inf = (ll)1e9+7;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return;
  }
  else if (n == 2) {
    cout << 3 << endl;
    return;
  }
  dp[0] = 1; dp[1] = 2;
  for (ll i = 2; i < n; i ++) {
    dp[i] = (1+(i%2)*red+(1-(i%2))*blue)%inf;
    if (i%2) {
      blue = (blue+dp[i])%inf;
    }
    else {
      red = (red+dp[i])%inf;
    }
  }
  cout << red+blue << endl;
  return;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}

#include <iostream>
using namespace std;
const long long MOD = 1e9+7;
int main(){
    int n;
    cin>>n;
    long long dp[n+1];
    dp[1]=1;
    dp[2]=2;
    dp[3]=3;
    dp[4]=5;
    long long r=5,b=7;
    if(n<5){
    	long long s=0;
	for(int i=1;i<=n;i++)s+=dp[i];
	cout<<s;
	return 0;
    }
    for(int i=5;i<=n;i++){
        if(i%2==1) //R
        {
            dp[i]=(b+1)%MOD;
            r+=b;
            r%=MOD;
        }
        else{
            dp[i]=(r+1)%MOD;
            b+=r;
            b%=MOD;
        }
    }
    long long ans=0;
    for(int i=1;i<=n;i++){
        ans+=dp[i];
        ans%=MOD;
    }
    cout<<ans;
    return 0;
}

#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
// #define md 1e9 + 7
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define ff first
#define ss second

using namespace std;

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt","w", stdout);
	#endif

	ll int  n;
	cin>>n;

	ll int dp1[n+1],dp2[n+1];
	memset(dp1,0,sizeof(dp1));
	memset(dp2,0,sizeof(dp2));

	dp1[1]=1;
	dp1[2]=2;

	dp2[1]=1;
	dp2[2]=2;

	ll int md = 1000000007;

	ll int ans=0;

	ans=3;

	for(ll int i=3;i<=n;i++)
	{
		dp1[i] = dp2[i-1]+1;
		dp2[i] = dp2[i-2] + dp1[i];
		dp1[i]%=md;
		dp2[i]%=md;

		ans+=dp1[i];

		ans%=md;
	}

	cout<<ans<<endl;

	return 0;
}

#include<iostream>
using namespace std;
const int maxn = (int)1e6 + 10;
const int MOD = (int)1e9 + 7;
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int n;
    cin>>n;
    long long res = 0,odd = 1,even = 1,cur;
    for(int i = 1; i <= n; i++)
    {
        if (i % 2 == 1)
        {
            odd = odd + even;
            odd %= MOD;
            res = res + odd;
        } else
        {
            even = even + odd;
            even %= MOD;
            res = res + even;
        }
        res %= MOD;
    }
    res -= 2;
    res += MOD;
    res %= MOD;
    cout<<res<<endl;
    return 0;
}

#ifndef Ashish
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define vll vector<ll>
#define vv vector<vector<ll>>
#define mll map<ll,ll>
#define sll set<ll>
#define pll pair<ll,ll>
#define F first
#define S second
#define pb(x) push_back(x)
#define f(i,a2,a3) for(ll i=a2;i<a3;i++)
#define fr(i,a2,a3) for(ll i=a2;i>a3;i--)
#define prll(v) for(auto it:v)cout<<it<<" ";cout<<endl;
#define InputOutput freopen("input.txt","r",stdin);//freopen("output.txt","w",stdout);
#define MAX(v) *max_element(v.begin(),v.end())
#define MIN(v) *min_element(v.begin(),v.end())
#define IOS  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#endif
int main(){
    #ifndef ONLINE_JUDGE
      InputOutput
      IOS
    #endif
    ll t=1;
  while(t--){
    ll n;
    cin>>n;
    ll count=1;ll ans=1;
    for(int i=2;i<=n;i++){
        ans=(ans+1+count)%mod;
        count=(ans-count)%mod;
        // cout<<ans<<endl;
    }
    cout<<ans<<endl;
  }
  return 0;
}

#include <iostream>
#include <vector>
using namespace std;

//let sequence start with one's
int main(){
    int n = 0;
    cin>>n;
    if(n == 1){
        cout<<1<<endl;
    }
    else{
        vector<int> ones(n+1);
        vector<int> zeros(n+1);
        ones[1] = 1;
        zeros[1] = 0;
        ones[2] = 1;
        zeros[2] = 2;
        for(int i = 3; i <= n; i++){
            if(i%2){
                zeros[i] = zeros[i-1];
                ones[i] = zeros[i-1]+1;
            }
            else{
                ones[i] = ones[i-1];
                zeros[i] = ones[i-1]+1;
            }
        }
        cout<<ones[n]+zeros[n]<<endl;
    }
    return 0;
}

#include<iostream>
#include<string>
using namespace std;
int a[1000001]={0};
int main()
{
	a[1]=1;
	int zero=0,one=1;
	for(int i=2;i<1000000;++i)
	{
		if(i%2==0)
		{
			zero=(zero+one+1)%1000000007;
		}
		else
		{
			one=(zero+one+1)%1000000007;
		}
		//cout<<one<<' '<<zero<<endl;
		a[i]=(one+zero)%1000000007;
	//	cout<<a[i]<<endl;
	}
	for(int n;cin>>n;)
		cout<<a[n]<<endl;
	return 0;

}

/*Author--Vishwas Agrawal*/
/*Author--Vishwas Agrawal*/
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define vll vector<ll>
#define pb push_back
#define mp make_pair
#define test    \
      ll t;     \
      cin >> t; \
      while (t--)
#define fio                             \
      ios_base::sync_with_stdio(false); \
      cin.tie(NULL);                    \
      cout.tie(NULL);
#define M 1000000007LL
#define input(v, n)   \
      inc(i, 0, n)    \
      {               \
            ll x;     \
            cin >> x; \
            v.pb(x);  \
      }
#define print(v, n) \
      inc(i, 0, n) { cout << v[i] << " "; }
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define inc(i, a, n) for (ll i = a; i < n; i++)
#define dec(i, a, n) for (ll i = n - 1; i >= a; i--)
long long binpow(long long base, long long exp, int mod)
{
      long long res = 1;
      while (exp > 0)
      {
            if (exp % 2 == 1)
                  res = (res * base) % mod;
            exp = exp >> 1;
            base = (base * base) % mod;
      }
      return res;
}
long long mod(long long x)
{
      return ((x % M + M) % M);
}

long long add(long long a, long long b)
{
      return mod(mod(a) + mod(b));
}

long long mul(long long a, long long b)
{
      return mod(mod(a) * mod(b));
}

int main()
{
      ll n;
      cin >> n;
      ll dp[n];
      dp[n - 1] = 1;
      dp[n - 2] = 2;
      ll ans = 3;
      for (ll i = n - 3; i >= 0; i--)
      {
            dp[i] = (dp[i + 1] + dp[i + 2]) % M;
            ans = (ans + dp[i]) % M;
      }
      cout << ans << endl;

      return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef  long long int ll;
int main()
{
    int n;
    cin>>n;ll f1=0,f2=1,ans=0,cnt=0;
    for(int i=1;i<=n;i++)
    {
        ans=(f1+f2)%1000000007;

        f1=f2;
        f2=ans;
        ans=(ans+cnt);
        cnt=ans;
    }
    cout<<ans;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
#define MAXN 2000005
void solve() {
    int n,o=0,e=0;
    cin>>n;
    int dp[n];
    dp[0]=1;dp[1]=3;
    o=1;e=3;
    for(int i=2;i<n;i++){
        dp[i]=dp[i-1]+abs(o-e)+1;
        if(i%2==0)o+=dp[i];
        else e+=dp[i];
    }
    cout<<dp[n-1]<<endl;
}
int32_t main() {
	int t=1;
// 	cin>>t;
while(t--){
// cout<<"Case"<<t<<endl;
solve();
}
	return 0;
}

#include <iostream>

using namespace std;
long long n,a[1000001];
int main()
{cin>>n;
a[1]=1; a[2]=3;
    for (int i=3;i<=n;i++) a[i]=a[i-1]+a[i-2]+2;
    cout<<a[n]<<endl;
    return 0;
}

#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
typedef unsigned long long int ll;
int main(){
    ll n,i;
    cin>>n;
    ll red[n+1];
    ll blue[n+1];
    ll f[n+1];
    f[1]=1;
    red[1]=1;
    blue[1]=0;
    for(i=2;i<=n;i++){
        if (i%2==0){
            red[i]=red[i-1];
            blue[i]=f[i-1]+1;
            f[i]=f[i-1]+red[i-1]+1;
        }
        else{
            blue[i]=blue[i-1];
            red[i]=f[i-1]+1;
            f[i]=f[i-1]+blue[i-1]+1;
        }
    }
    cout<<f[n];
}

#include<bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long int ll;
double PI=4.00*(atan(1));
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    if(n==1)
    {
        cout<<"1";
        exit(0);
    }
    if(n==2)
    {
        cout<<"2";
        exit(0);
    }
    ll init=1,temp;
    ll final=2;
    ll ans=3;
    n-=2;
    for(ll i=1;i<=n;i++)
    {
        temp=final;
        final=(final+init)%MOD;
        init=temp;
        ans=(ans+final)%MOD;
    }
    cout<<ans;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define MAXN 2000005
void solve() {
    int n,o=0,e=0;
    cin>>n;
    int dp[n];
    dp[0]=1;dp[1]=3;
    o=1;e=3;
    for(int i=2;i<n;i++){
        dp[i]=(dp[i-1]+abs(o-e)+1)%mod;
        if(i%2==0)o=(o+dp[i])%mod;
        else e=(e+dp[i])%mod;
    }
    cout<<dp[n-1]<<endl;
}
int32_t main() {
	int t=1;
// 	cin>>t;
while(t--){
// cout<<"Case"<<t<<endl;
solve();
}
	return 0;
}

#include <assert.h>
#include <bits/stdc++.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <iostream>
#include <list>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef string str;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;

#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define trav(a, x) for (auto &a : x)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define PRINT_ARRAY(a, N)        \
  F0R(z, N) cout << a[z] << " "; \
  cout << "\n"

const int MOD = 1000000007;  // 998244353
const ll INF = 1e18;
const ld PI = 4 * atan((ld)1);

long long binpow(long long a, long long b, long long m) {
    a %= MOD;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}

int main() {
		ios_base::sync_with_stdio(false);
		cin.tie(NULL);
		cout.tie(NULL);
		ll N;
		cin >> N;

		ll ans = binpow(2, N - 1, MOD);
		ans += (N - 1);

		cout << ans << endl;
}

    //Catchharsh
    //I Luv Kunj017
    #include<bits/stdc++.h>
    #define ll long long int
    #define ld long double
    #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define F first
    #define S second
    #define pb push_back
    #define endl '\n'
    const ll MOD = 1e9+7;
    const ll INF = 1011111111;
    const ll LLINF = 1000111000111000111LL;
    const ld EPS = 1e-10;
    const ld PI = 3.14159265358979323;
    using namespace std;
    ll power (ll x,ll n)
    {
        if(n==0)
        return 1;
        else if(n%2==0)
        return power((x*x),n/2);
        else
        return x*power((x*x),(n-1)/2);
    }
    int main()
    {
         IOS;
         ll n,m,i,j,k;
         cin>>n;
         if(n==1)
          return cout<<1,0;
         ll cum[n]={0};
         ll dp[n+1]={0};
         cum[0]=1;
         dp[0]=1;
         dp[1]=2;
         cum[1]=2;
         ll ans=3;
         for(i=2;i<n;i++)
         {
            dp[i]=cum[i-1]+1;
            cum[i]=dp[i]+cum[i-2];
            ans+=dp[i];
         }
         cout<<ans;
    }

#include <bits/stdc++.h>
#define I int64_t
using namespace std;
int M = 1e9+7;

int main() {

    //freopen("in.txt", "r", stdin);
    int n;
    cin >> n;
    vector<int> dp(max(n+1, 3), 0);
    dp[0]=0;
    dp[1]=1;
    dp[2]=3;
    for (int i=3; i<= n; i++)
        dp[i]= (i + dp[i-1] + dp[i-3]) % M;
    cout << dp[n] << endl;

}

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)

const int md = 1000000007;

int main() {
    int n;
    cin >> n;
    int cnt[2] = {0, 0};
    rep (i, n) {
        bool curcol = i % 2;
        cnt[curcol] += cnt[!curcol] + 1;
        cnt[curcol] %= md;
    }
    cout << cnt[0] + cnt[1] << endl;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define CLR(a) memset(a, 0, sizeof(a))
#define vl vector<ll>
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define MOD 1000000007
#define fi first
#define sec second
#define pb push_back
#define rep(a, b) for(a = 0; a < b; a++)
#define rep2(a, b) for(a = 1; a <= b; a++)
#define all(a) a.begin(), a.end()
#define pq priority_queue
#define vi vector<int>
#define vii vector<pair<int,int>>
#define pii pair<int,int>
#define endl "\n"
#define vpll vector< pair<pll,pll> >
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define oo return 0;

/*set reverse order set<ll, greater<ll> >
  priority queue reverse order priority_queue<ll, vector<ll>, greater<ll> > pq*/

ll mat[26][26];

int main()
{
   	ios_base::sync_with_stdio(false);
   	cin.tie(NULL);
	ll n, sum = 3;
	cin >> n;
	vector<ll> dp(n+1, 0);
	dp[1] = 1, dp[2] = 2;
	if(n == 1)
	{
		cout << 1 << endl;
		oo
	}
	if(n == 2)
	{
		cout << 2 << endl;
		oo
	}
	for(ll i = 3; i <= n; i++)
	{
		dp[i] += dp[i-1]+dp[i-3]+1;
		dp[i] %= MOD;
		// cout << dp[i] << " ";
		sum += dp[i];
		sum %= MOD;
	}
	// cout << endl;
	cout << sum << endl;
 	oo
}

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

#define CLR(a) memset(a, 0, sizeof(a))
#define vl vector<ll>
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define MOD 1000000007
#define fi first
#define sec second
#define pb push_back
#define rep(a, b) for(a = 0; a < b; a++)
#define rep2(a, b) for(a = 1; a <= b; a++)
#define all(a) a.begin(), a.end()
#define pq priority_queue
#define vi vector<int>
#define vii vector<pair<int,int>>
#define pii pair<int,int>
#define endl "\n"
#define vpll vector< pair<pll,pll> >
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define oo return 0;

/*set reverse order set<ll, greater<ll> >
  priority queue reverse order priority_queue<ll, vector<ll>, greater<ll> > pq*/

ll mat[26][26];

int main()
{
   	ios_base::sync_with_stdio(false);
   	cin.tie(NULL);
	ll n, sum = 3;
	cin >> n;
	vector<ll> dp(n+1, 0);
	dp[1] = 1, dp[2] = 2;
	if(n == 1)
	{
		cout << 1 << endl;
		oo
	}
	if(n == 2)
	{
		cout << 3 << endl;
		oo
	}
	for(ll i = 3; i <= n; i++)
	{
		dp[i] += dp[i-1]+dp[i-3]+1;
		dp[i] %= MOD;
		// cout << dp[i] << " ";
		sum += dp[i];
		sum %= MOD;
	}
	// cout << endl;
	cout << sum << endl;
 	oo
}

#include <bits/stdc++.h>
using namespace std;

int main() {
    long long int n;
    cin>>n;
    long long int m=1000000007;
    long long int a=1,b=3,r;
    for(int i=2;i<n;i++){
        r=b;
        b=(a+b+2)%m;
        a=r;
    }
    cout<<b;
	return 0;
}

#include <iostream>
#include <string>
#include <cstdio>
#include <memory.h>
#include <algorithm>
using namespace std;

const int MAXN = 1000000;
const long long MOD = 1000000007;
int n;
long long f[MAXN+1];

int main(){
	f[0] = 0;
	f[1] = 1;
	f[2] = 3;
	f[3] = 6;
	f[4] = 11;
	long long sum;
	for (int i=5;i<=MAXN;i++){
		int t = (i-1)/2;
		if (i%2 == 0) sum = t*t;
		else sum = t*(t-1);
		sum %= MOD;
		f[i] = f[i-1] + i + sum;
		f[i] %= MOD;
	}
	while (scanf("%d",&n) != EOF){
		printf("%lld\n",f[n]);
	}
	return 0;
}

    //Catchharsh
    //I Luv Kunj017
    #include<bits/stdc++.h>
    #define ll long long int
    #define ld long double
    #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define F first
    #define S second
    #define pb push_back
    #define endl '\n'
    const ll MOD = 1e9+7;
    const ll INF = 1011111111;
    const ll LLINF = 1000111000111000111LL;
    const ld EPS = 1e-10;
    const ld PI = 3.14159265358979323;
    using namespace std;
    ll power (ll x,ll n)
    {
        if(n==0)
        return 1;
        else if(n%2==0)
        return power((x*x),n/2);
        else
        return x*power((x*x),(n-1)/2);
    }
    int main()
    {
         IOS;
         ll n,m,i,j,k;
         cin>>n;
         ll cum[n]={0};
         ll dp[n+1]={0};
         cum[0]=1;
         dp[0]=1;
         ll ans=1;
         for(i=1;i<n;i++)
         {
            if(i-3>=0)
              {dp[i]+= 1+dp[i-1]+cum[i-3];cum[i]=cum[i-3]+dp[i];}
            else
              {dp[i]+= 1+dp[i-1];cum[i]=dp[i];}
            ans+=dp[i];
         }
         cout<<ans;
    }

#include<cstdio>
#include<cstring>
const __int64 maxn=10005;
__int64 dp[maxn];
int  main()
{
    __int64 n;
    __int64 i,j,k;
    while(scanf("%I64d",&n)!=-1)
    {
        memset(dp,0,sizeof(dp));
        __int64 ji=0,ou=0;
        __int64 ans=0;
        for(i=0;i<n;i++)
        {
            dp[i]=1;
            if(i%2)
            {
                dp[i]+=ou;
                ji+=dp[i];
            }
            else
            {
                dp[i]+=ji;
                ou+=dp[i];
            }
            ans+=dp[i];
        }
        printf("%I64d\n",ans);
    }
    return 0;
}

#include<iostream>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<vector>

using namespace std ;
#include <unordered_map>

int main(){
  int n ;
  cin >> n ;
  int*output = new int[n+1] ;
  output[0] = 0 ;
  output[1] = 1 ;

  for(int i =2 ; i <= n ; i++){
    output[i] = output[i-1] + output[i-2] +1 ;

  }
  cout << output[n] + output[n-1] ;

}

#include <cstdio>
using namespace std;

const int INF = 1000000007;

int main(){
    int n,dp[2]={1,1};
    scanf("%d",&n);
    for(int i=0;i<n;i++) dp[i&1]=(dp[i&1]+dp[~i&1])%INF;
    printf("%d\n",dp[0]+dp[1]-2);
}

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (int)(a.size())
#define lb lower_bound
#define ub upper_bound
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
#define MOD (ll)(1e9+7)
#define INF (ll)(1e18)
#define debug(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false);\
debug("%s time : %.4fs\n", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> PII;
typedef pair<int,int> pii;
typedef vector<vector<int>> vii;
typedef vector<vector<ll>> VII;
ll gcd(ll A,ll B) {if(!B)return A;return gcd(B,A%B);}
int main()
{
	ll n;
	cin>>n;
	if(n == 1){cout<<0;return 0;}
	vector<ll>dp(n,1);
	ll even_sum = 1;
	ll odd_sum = 0;
	for(int i=1;i<n;i++){
		if(i%2 == 0){
			dp[i]+=odd_sum;
		}else{
			dp[i]+=even_sum;
		}
		dp[i]%=MOD;
		if(i%2==0)even_sum+=dp[i];
		else odd_sum+=dp[i];
		even_sum%=MOD;
		odd_sum%=MOD;
	}
	ll ans = 0;
	for(int i=0;i<n;i++){ans+=dp[i];ans%=MOD;}
	cout<<ans;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll n, a, jumm, jumb, ans;

int main(){
	ios_base::sync_with_stdio(0);

	cin>> n;

	for(ll i = 1; i <= n; i++){
		a = 0;
		if(i % 2 == 1){
			a += jumb + 1;
			jumm += a;
			(ans += a) % 1000000007 ;
		}
		else{
			a += jumm + 1;
			jumb += a;
			(ans += a) % 1000000007;
		}
	}
	cout<< ans % 1000000007 << '\n';
	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
#include <cctype>
typedef long long ll;
#define MAX 1000035
using namespace std;
#define INF 2147483647
#define inf 1<<30
#define MOD 1000000007
#define EPS 1e-9
#define G 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
bool debug = false;
int n,m, k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};

ll dp[MAX][2];
int main(){
   // scanf("%d", &n);
    n=1;
    dp[1][1]=1;
    for(int i=2;i<=n;i++) {
        int c = i&1;
        dp[i][1-c] = dp[i-1][1-c];
        dp[i][c] = (dp[i-1][c] + dp[i-1][1-c] + 1)%MOD;
    }
    printf("%lld\n", (dp[n][0]+dp[n][1])%MOD );
    return 0;
}

#include<bits\stdc++.h>
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define infi INT_MAX
#define inf 1LL<<60
#define ff first
#define ss second
using namespace std;
const int mod=1e9+7;
main()
{
    fast
    int tc,i,j,k;
    tc=1;
    while(tc--)
    {
        int a,ans=0,t=0;
        cin>>a;
        if(a==1)
            cout<<1<<endl;
        else if(a==2)
            cout<<3<<endl;
        else{
        int aa[a],pre[a+10];
        if(a>=2)
        aa[a-1]=1,aa[a-2]=1;
        for(i=a-3;i>=0;i--)
            aa[i]=aa[i+2]+1;
        for(i=0;i<a;i++)
        {
            if(i>=2 && i<a-1)
            {
                t=aa[i-1]-aa[i+1];
               // cout<<t<<" "<<i<<endl;
                t=t*(i+1)%mod;
            }
            if(i<=1)
            {
                 t=aa[i+1];
                t=t*(i+1)%mod;
            }
            if(i==a-1)
            {
                t=i+1;
            }
            // cout<<t<<" "<<i<<endl;
            ans=(ans+t)%mod;
        }
       // ans+=a%mod;
        cout<<ans<<endl;
        }

    }
}

#ifdef LOCAL
#include <iostream>
#define debug(x) cerr<<"["<<#x<<"]: "<<x<<endl;
#define EPS 0.0000001
#else
#include <bits/stdc++.h>
#define debug(x) 42
#define debug_c(a) 42
#endif

using namespace std;

#include <cmath>

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

    int n; cin >> n;

    cout << (long long int)(pow(2, n - 1) + n - 1) % 1000000007 << endl;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vi          vector<int>
#define vll         vector<ll>
#define vpii        vector<pair<int, int> >
#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define vpll        vector<pll>
#define vvi         vector<vi>
#define mii         map<int,int>
#define hell        LONG_LONG_MAX
#define fi          first
#define se          second
#define ite         iterator
#define pb          push_back
#define mp          make_pair
#define endl        "\n"
#define f(i,a,b)    for(int i=a;i<b;i++)
#define all(a)      a.begin(),a.end()

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    int n;cin>>n;
    ll a,b,c;a=0;b=1;c=1;ll x,y,z;x=1;y=1;
    for(int i=2;i<=n;i++){
        z=x+y;
        x=y;y=z;
        c=b+z;
        a=b;b=c;
    }
    cout<<c%(1000000007);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	long long a,res=0,i,aux=0;
	cin>>a;
	for(i=a;i>0;i--){
		res+=i;
		res%=1000000007;
	}
	for(i=2;i<a-1;i++){
		aux+=(a/i-1);
		aux%=1000000007;
	}
	res+=aux;
	cout<<res<<endl;
}

#include<bits/stdc++.h>
using namespace std;

 int main()
 {
     long long n;
     cin>>n;
     long long ans=(n*(n+1))/2;
     if(ans>1000000007){
        if(n%2==0) ans=(ans+1)%1000000007;
        else ans=ans%1000000007;
        return cout<<ans<<endl,0;
     }
     return n%2==0?cout<<1+ans<<endl:cout<<ans<<endl,0;
 }

#include<bits/stdc++.h>
#define ios std::ios::sync_with_stdio(false)
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,n,a) for (int i=n;i>=a;i--)
#define int long long
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(),a.end()
#define mst(a,n) memset(a,n,sizeof(a))
#define dbg(a, b) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<'\n';
#define debug(a, b, c, d)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<'\n';
#define debugg(a, b, c, d, e, f)  cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "#e<<": "<<e<<" | "<<#f<<": "<<f<<'\n';
#define ppp cout << '\n';
#define p(x) cout << x << '\n',
#define break(x) {cout << x << '\n'; break;}
#define continue(x) {cout << x << '\n'; continue; }
#define printa(a,l,r) rep(_i,l,r) {cout << a[_i] << " \n"[_i==r];}
#define printaa(a,u,d,l,r) rep(_i,u,d)rep(_j,l,r) {cout<<a[_i][_j]<<" \n"[_j==r];}
#define printset(st) for(auto _it:st){cout << _it << " ";} cout << '\n';
#define printmap(mp) for(auto &_it:mp){cout << _it.se << " ";} cout << '\n';//ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
//ll lcm(ll a,ll b){return a*b/gcd(a,b);}
//ll pow_mod(ll x,ll n,ll mod){ll res=1;while(n){if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}
//ll fact_pow(ll n,ll p){ll res=0;while(n){n/=p;res+=n;}return res;}
//ll mult(ll a,ll b,ll p){a%=p;b%=p;ll r=0,v=a;while(b){if(b&1){r+=v;if(r>p)r-=p;}v<<=1;if(v>p)v-=p;b>>=1;}return r;}
//freopen("C:/Users/zyj19/Desktop/out.txt","w",stdout);int num = 0;time_t begin,end;double ret;begin=clock();end=clock();ret=double(end-begin)/CLOCKS_PER_SEC;cout<<"runtime: "<<ret<<endl;fclose(stdout);

using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
template<typename T>void read(T &res){bool flag=false;char ch;while(!isdigit(ch=getchar()))(ch=='-')&&(flag=true);for(res=ch-48;isdigit(ch=getchar());res=(res<<1)+(res<<3)+ch - 48);flag&&(res=-res);}
template<typename T>void Out(T x){if(x<0)putchar('-'),x=-x;if(x>9)Out(x/10);putchar(x%10+'0');}
//struct Edge{int nxt,to;}e[N<<1];int head[N],TOT;void add_edge(int u,int v){e[++TOT].nxt=head[u];e[TOT].to = v;head[u] = TOT;}
//struct node{int k,l,r;bool operator <(const node& A)const{return k < A.k;}};
//const ll INF = 0x3f3f3f3f3f3f3f3f;

const int N = 1e6 + 10, MOD = 1e9+7, inf = 0x3f3f3f3f;
int dp[N];
signed main()
{
	int n;
	cin >> n;
	int one = 0, two = 0;
	dp[0] = 0;
	for (int i = 1; i <= n; i++){
		if (i & 1)
		{
			dp[i] = dp[i-1] + two + 1;
			dp[i] = dp[i] % MOD;
			one += two + 1;
		}
		else{
			dp[i] = dp[i-1] + one + 1;
			dp[i] = dp[i] % MOD;
			two += one + 1;
		}
	}
	cout << dp[n] << '\n';
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long wynik[1000001];
    long long m=1000000007;
    wynik[0]=0;
    wynik[1]=1;
    wynik[2]=3;
    wynik[3]=6;
    wynik[4]=11;
    for(int i=5;i<1000001;i++){
        wynik[i]=wynik[i-1]+wynik[i-2]+2%m;
    }
int n;
cin>>n;
cout<<wynik[n];
return 0;
}

#include <cmath>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<cctype>
#include <iomanip>
#include <string>
#include <sstream>

#include <functional>
#include <numeric>
#include <stack>
#include <climits>
#include <float.h>
#include<unordered_map>
#include <bitset>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define f(i,a,b) for(int i=a;i<b;i++)
#define F(i,a,b) for(int i=a;i>=    b;i--)
#define sz(a) ((int)a.size())
#define all(c) c.begin(), c.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl
#define sz(a) ((int)a.size())

//#define fast ios_base::sync_with_stdio(0);cin.tie(0) ;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;

typedef vector<pair<int, int> > vpii;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef long double ld;

template <class T> const T& max(const T& a, const T&b, const T&c) { return max(a, max(b, c)); }

template <class T> const T& min(const T& a, const T&b, const T&c) { return min(a, min(b, c)); }

void sc(int &a) { scanf("%d", &a); }void sc(ll &a) { scanf("%lld", &a); }void sc(int& a, int& b) { sc(a); sc(b); }
void sc(ll &a, ll &b) { sc(a); sc(b); }void sc(int& a, int& b, int& c) { sc(a, b); sc(c); }void sc(ll& a, ll& b, ll& c) { sc(a, b); sc(c); }
void prl(int a) { printf("%d\n", a); }void prl(ll a) { printf("%lld\n", a); }void prl() { printf("\n"); }
void prs(int a) { printf("%d ", a); }void prs(ll a) { printf("%lld ", a); }

ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }

ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

ll poww(ll a, ll b) {

	if (b == 0) return 1;

	ll tmp = poww(a, b / 2);

	return (b & 1 ? a * tmp * tmp : tmp * tmp);

}

ll sumOfDigs(string s) { ll sum = 0; for (int i = 0; i < s.length(); i++) sum += s[i] - '0'; return sum; }

ll sumOfDigs(ll n) { return (n < 10 ? n : n % 10 + sumOfDigs(n / 10)); }

string itos(ll i) { string s = ""; 	while (i) { s += char(i % 10 + '0'); i /= 10; } reverse(all(s));  return s; }

ll stoi(string &s) { ll tot = 0; for (int i = (int)s.length() - 1, j = 1; i >= 0; i--, j *= 10) { tot += j * (s[i] + '0'); }  return tot; }

int months[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

using namespace std;

#define PI acos((ld)-1.0)

// printf("%.8lf\n", sum * 1.0 / n);  // precision setting

ll mod = 1e9 + 7;

void tt() {

#ifndef online	_judge
	freopen("test.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

#endif
}

ll modpower(ll x, ll y, ll p)
{

	x %= mod;

	if (!y) return 1;

	ll res = 1;

	if (y & 1) { res *= x;  res %= p; }

	ll z = modpower(x, y / 2, p);

	z %= p;

	z *= z;

	z %= mod;

	res *= z;

	res %= p;

	return res;

}

int main() {

	ll n;
	cin >> n;

	ll tot = 0;

	ll start = 0, prevSum = 0;

	for (int i = 1; i <= n - 1; i++) {

		if (i & 1) {

			start++;
			prevSum += start;

		}

		else {

			prevSum += start;
		}

		//cout << "i: " << i << " prevSum: " << prevSum << endl;

		tot += prevSum;

	}

	tot += n;

	cout << tot << endl;

	return  0;
}

#include <cstdio>
#include <memory.h>
#include <cstring>
#include <vector>
#include <deque>
#include <cstdlib>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <functional>
#include <set>
#include <list>
#include <map>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef unsigned long long llu;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
const ll MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;

int dp[1000000][2];
int n;

// 최근에 남긴 게 무슨 색이었는 지.
// 짝수라면 0, 홀수라면 1
int go(int o, int pre) {
	if (o == n) return 1;
	if (dp[o][pre] != -1) return dp[o][pre];

	int sum = 0;
	if (o % 2) {
		sum += go(o + 1, pre);
		if(pre == 0) sum += go(o + 1, pre ^ 1);
	}
	else {
		sum += go(o + 1, pre);
		if (pre) sum += go(o + 1, pre ^ 1);
	}

	return dp[o][pre] = sum % MOD;
}

int main() {
	scanf("%d", &n);
	memset(dp, -1, sizeof(dp));

	ll sum = go(0, 0) + go(0, 1) - 2;
	printf("%lld", sum + MOD % MOD);
}

#include<iostream>
#include<cstring>
#include<stdio.h>
using namespace std;
long long a[1000001]={0,1,3};
int main()
{
	int i=3;
	for(;i<=100000;i++)
	{
		a[i]=(a[i-1]%1000000007+a[i-2]%1000000007+2)%1000000007;
	}
	int n;
	while(cin>>n)
	{
		cout<<a[n]<<endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mod 1000000007

ll dp[1000005];

int main() {
    ll n; cin >> n;

    dp[1] = 1;
    dp[2] = 2;

    for(ll i = 3; i <= 1000004; i++)
        dp[i] = (dp[i-1] + dp[i-2]) % mod;

    for(ll i = 1; i <= n; i++)
        dp[i] += dp[i-1];

    cout << dp[n] << endl;
}

/*input
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define I insert
ll M=1e9;
int main() {
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	ll a,n,b,c,d,e,i,j,k;
	cin>>n;
	a=b=0;
	for(i=1;i<=n;i++)
	{
		if(i&1)a+=b+1,a%=M;
		else b+=a+1,b%=M;
	}
	cout<<(a+b)%M;
	return 0;
}

#include <iostream>
using namespace std;
int main() {
	int n, a[3], ans = 3, md = 1e9 + 7; cin >> n;
	a[0] = 1, a[1] = 2;
	for (int i = 2; i < n; i++) a[i % 3] = (a[(i - 1) % 3] + a[(i - 2) % 3]) % md, ans = (ans + a[i % 3]) % md;
	cout << ans  << endl;
}

#include<bits/stdc++.h>
using namespace std;

// Shortcut

#define int long long
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define Ford(i, r, l) for (int i = r; i > l; i--)
#define FordE(i, r, l) for (int i = r; i >= l; i--)
#define Fora(i, a) for (auto i : a)

// I/O & Debug

#define PrintV(a) for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
#define PrintVl(a) for (int i = 0; i < a.size(); i++) cout << a[i] << endl;
#define PrintA(a, n) for (int i = 0; i < n; i++) cout << a[i] << ' ';
#define PrintAl(a, n) for (int i = 0; i < n; i++) cout << a[i] << endl;
#define Ptest(x) return cout << x, 0;
#define gl(s) getline(cin, s);
#define setpre(x) fixed << setprecision(x)
/*
#define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
void DEB(istream_iterator<string> it) {}
template<typename T, typename... Args>
void DEB(istream_iterator<string> it, T a, Args... args){
    cout << *it << " = " << a << endl;
    DEB(++it, args...);
}
*/

// Functions

#define bend(a) a.begin(),a.end()
#define mset(a) memset(a, 0, sizeof(a));
#define sortV(a) sort(bend(a));
#define sortA(a, n) sort(a, a + n);
#define rev(s) reverse(bend(s));
//mt19937 rando(chrono::steady_clock::now().time_since_epoch().count());

// Data Structure

#define pque priority_queue
#define mts multiset
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <ld> vld;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vi > vvi;
typedef vector <vll > vvll;
typedef vector <pii > vpii;
typedef vector <pll > vpll;

const int N = 1e5 + 5, mod = 1e9 + 7, inf = 1e18 + 7;

int n;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> n;
    int t = 0, a = 1, b = 1;
    ForE(i, 1, n){
        t = (t + b) % mod;
        b = (b + a) % mod;
        a = (a - b) % mod;
    }
    while (t < 0) t += mod;
    cout << t;
}

/*
==================================+
INPUT:                            |
------------------------------    |

------------------------------    |
==================================+
OUTPUT:                           |
------------------------------    |

------------------------------    |
==================================+
*/

#include<stdio.h>
#include<iostream>
#include<algorithm>
#define M 1000000007
using namespace std;
int main()
{
   long long a[4];
   int i,j,n;
   while(scanf("%d",&n)!=EOF){
	        a[0]=0,a[1]=1,a[2]=3;
        for(i=3;i<=n;i++)
			a[i%4]=(2*a[(i-1)%4]-a[(i-3)%4])%M;
	        printf("%lld\n",a[(i-1)%4]);
   }
  return 0;
}

 #include <bits/stdc++.h>
	 using namespace std;

	#define fast ios_base::sync_with_stdio(0);cin.tie(0);
	#define LL long long int
	#define pb push_back
	#define mp make_pair
	#define PII pair<int,int>
	#define PLL pair<LL,LL>
	#define PIS pair< int,string>

	#define VI vector <int>::iterator it;
	#define VL vector <LL>::iterator lt;
	#define VPI vector <PII>::iterator pit;
	#define VPL vector <PLL>::iterator plt;

	#define test int t;cin>>t;while(t--)
	#define ff first
	#define ss second
	#define N 1000000
	#define INF 1000000000
	#define INIT(a,x) memset(a,x,sizeof(a))
	#define input(a,n) for(i=0;i<n;i++)cin>>a[i];
	#define output(a,n) for(i=0;i<n;i++)cout<<a[i]<<" ";
	//const int N=1234567;

	 int main()
	 {
	 	fast;
	 	LL n,k,m=1000000007;
	 	cin>>n;
	 	k=(n*(n+1)/2)%m;
	 	if(n%2==0)
	 	{
	 		k=(k+1)%m;
	 		cout<<k;
	 		return 0;
	 	}
	 	else
	 	{
	 		cout<<k;
	 		return 0;
	 	}
	 }

//#include "stdafx.h"
#include <iostream>

int main()
{
	int n(0);
	std::cin >> n;

	static int redStart[1000005] = { 0 }, blueStart[1000005] = { 0 };
	redStart[1] = 1;
	blueStart[1] = 0;
	for (int i = 2; i <= n; i++)
	{
		if (i % 2 == 0)
		{
			redStart[i] = 1 + (i >= 3 ? blueStart[i - 2] : 0) +
				(i >= 4 ? redStart[i - 3] : 0);
			blueStart[i] = blueStart[i - 2] + redStart[i - 1] + 1;
		}
		else
		{
			redStart[i] = redStart[i - 2] + blueStart[i - 1] + 1;
			blueStart[i] = 1 + (i >= 3 ? redStart[i - 2] : 0) +
				(i >= 4 ? blueStart[i - 3] : 0);
		}
	}

	std::cout << redStart[n] + blueStart[n] << std::endl;
	return 0;
}

#include <iostream>
const int MOD = 1000000007;
using namespace std;
int main(){
    int n;
    cin >> n;
    int f[n + 1];
    f[0] = 1;
    f[1] = 2;
    for(int i = 2; i <= n; i++){
        f[i] = f[i - 1] + f[i - 2];
        f[i] %= MOD;
    }
    int cntr;
    for(int i = 0; i < n; i++){
        cntr += f[i];
        cntr %= MOD;
    }
    cout << cntr << endl;
}

#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll dp[1069696];

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n;
	cin >> n;
	ll juma=0,jumb=0;
	for(int i=1; i<=n; i++){
		dp[i]=1;
		if(i%2==1){
			dp[i]+=jumb;
			juma+=dp[i];
		}
		else{
			dp[i]+=juma;
			jumb+=dp[i];
		}
	}
	ll jwb=0;
	for(int i=1; i<=n; i++)jwb+=dp[i];
	cout << jwb << endl;
}

#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <iomanip>
#include <climits>
using namespace std;
typedef long long int ll;
#define MOD 1000000007
#define INF 1000000000000000000
#define endll "\n"
#define pb push_back
#define forn(i,n) for(i=0;i<n;i++)
#define forab(i,a,b) for(i=a;i<=b;i++)
#define vpll vector<pair<ll,ll>>
#define vvll vector<vector<ll>>
#define pll pair<ll,ll>
#define vll vector<ll>
#define ff first
#define ss second
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define test ll t;cin>>t; while(t--)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
void inout()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
#endif
}
int main()
{
  fast_io;
  inout();
  ll n,i;
  cin>>n;
  ll dp[n+1][2];
  dp[1][0]=0;
  dp[1][1]=1;
  for(i=2;i<=n;i++)
  {
    if(i%2==0)
      dp[i][0]=(dp[i-1][1]+dp[i-1][0]+1)%MOD,dp[i][1]=(dp[i-1][1])%MOD;
    else
      dp[i][1]=(dp[i-1][0]+dp[i-1][1]+1)%MOD,dp[i][0]=dp[i-1][0]%MOD;
  }
  cout<<dp[n][0]+dp[n][1]<<endl;
  return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <queue>
#include <string>
#include <map>
using namespace std;
#define rep(i,s,t) for (int i = (int)s; i < (int)t; i++)
#define repd(i,s,t) for (int i = (int)s; i >= (int)t; i--)
const int MAXN = 1111111;
const long long INF = 0x7FFFFFFFFFFFFFFFLL;
string s;

int main() {
    long long a, b, c;
    while (cin >> a >> b >> c) {
        if (a > b) swap(a, b);
        if (a > c) swap(a, c);
        if (b > c) swap(b, c);
        if ((a + b) % 2 == 1) {
            cout << c << endl;
        } else {
            cout << b << endl;
        }
    }
}

#include <iostream>
#include <cmath>
#include <fstream>

using namespace std;

const int dim = 1000003;
const int mod = 1000000007;

int n,dp[dim];

int main()
{
    cin >> n;
    dp[1] = 1;
    dp[2] = 3;
    dp[3] = 6;
    dp[4] = 11;
    if (n == 1)
    {
        cout << "1";
        return 0;
    }
    if (n == 2)
    {
        cout << "3";
        return 0;
    }
    if (n == 3)
    {
        cout << "6";
        return 0;
    }
    for (int i=4; i<=n; i++)
    {
        dp[i] = ((2*dp[i-1])%mod - dp[i-3])%mod;
    }
    cout << dp[n];
    return 0;
}

#define NDEBUG

#include <bits/stdc++.h>

using namespace std;
using pii = pair<int, int>;

#ifdef NDEBUG
#  define debug(...)
#else
#  include "debug.hh"
#endif

const int MOD = 1e9+7;
int n;

int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  cin >> n;
  int dp[] = {1, 0};
  for (int i = 1; i < n; i++) dp[i%2] = (dp[i%2] + dp[1-i%2] + 1) % MOD;
  cout << dp[0] + dp[1] << endl;
  return 0;
}

#include<iostream>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<vector>

using namespace std ;
#include <unordered_map>

int main(){
  int n ;
  cin >> n ;
  int*output = new int[n+1] ;
  output[0] = 0 ;
  output[1] = 1 ;

  for(int i =2 ; i <= n ; i++){
    output[i] = output[i-1] + output[i-2] +1 ;

  }
  cout << output[n] + output[n-1] ;

}

#include<bits/stdc++.h>
#include<algorithm>

using namespace std;
#define ll          long long
#define double      long double
#define endl        '\n'
#define sz(x)       (int)(x).size()

#define pb          push_back
#define pf          push_front
#define lb(v,n)     lower_bound(all((v)),(n))
#define ub(v,n)     upper_bound(all((v)),(n))

#define vi          vector<int>
#define vll         vector<ll>
#define vii         vector<pii>
#define vpll        vector<pll>
#define viiii       vector<pair<pii,pii>>

#define mi          map<int,int>
#define mll         map<ll,ll>
#define mii         map<pii,int>

#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define piii        pair<int,pair<int,int>>
#define piiii       pair<pii,pii>
#define fi          first
#define se          second
#define mp          make_pair
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()

#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define rreps(X,S,Y) for (int (X) = (Y)-1;(X) >= (S);--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define toit ios::sync_with_stdio(0);cin.tie(0);

#define w(x)		int x; cin>>x; while(x--)

const int mod = 1e9 + 7;

int logb(int base, int x) {
	return (log(x) / log(base));
}
int occurs(vll v, int n) {
	auto it = lb(v, n); auto it1 = ub(v, n); int x = it1 - it; return x;
}

ll gcd(ll a, ll b) {  if (b == 0)  return a; return gcd(b , a % b); }

ll powm(int a, int b) {
	ll res = 1;
	while (b) {
		if (b & 1)
			res = (res * 1LL * a) % mod;
		b >>= 1;
		a = (a * 1LL * a) % mod;

	}
	return res;
}

ll nCr(ll n , ll k)
{	int fact[n];
	ll res = (fact[n] * powm(fact[k] , mod - 2)) % mod;
	return (res * powm(fact[n - k] , mod - 2)) % mod;
}

//---------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------//
int dp[1000005];

int main()
{	toit
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n;
	cin >> n;
	dp[1] = 1;
	dp[2] = 3;
	dp[3] = 6;

	for (int i = 4; i <= n; i++) {
		dp[i] = 2 * dp[i - 1] - dp[i - 3];
	}
	cout << dp[n];
	return 0;
}

#include<bits/stdc++.h>

using namespace std;
#define ll long long
ll mod = 1000000007;
ll num[1000099];
void check()
{
    num[1] = 1;
    num[2] = 3;
    num[3] = 6;
    for(int i=4; i<=1000006; i++)
    {
        num[i] = 2 + ((i % mod) + (num[i-1] % mod))%mod;
    }
}
int main()
{

    check();
    ll n;
    cin>>n;
    cout<<num[n]<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int                 long long
#define dl                  double
#define pb                  push_back
#define F                   first
#define S                   second
#define endl                "\n"
#define rep(i,a,b)          for(int i=a;i<b;i++)
#define all(v)              v.begin(),v.end()
#define allr(v)             v.rbegin(),v.rend()
#define mod                 1000000007LL
#define CIN(V,s,n)          for(int i=s;i<n;i++){cin >> V[i];}
#define COUT(V,s,n)         {for(int i=s;i<n;i++){cout <<  V[i] << " "  ;} cout << endl;}
#define fast                ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define CLEAR(V);           for(ll i=0;i<V.size();i++) V[i] = 0;
#define N                   101LL
#define tmod                998244353LL
typedef set<int> si;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector < vector<int> >  vii;

int gcd(int a,int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
bool sortbyval(const pair<string, int> &a, const pair<string, int> &b)
{
    return (a.second > b.second);
}
//bool P[N+1];
void sieve(int n){
    bool p[n+1];
    memset(p,true,sizeof(p));
    //p[0] = false;
    //p[1]= false;
    //for(int i=1;i<=n;i++) P[i] = i;
    for(int i=2;i*i<=n;i++)
    {
        if(p[i]==true)
        {
            for(int j=i*i;j<=n;j+=i)
            {
                if(p[j]==true) p[j]=false;
            }
        }
    }
    for(int i=2;i<=n;i++){
        if(p[i]){
            cout<<i<<" ";
        }

    }
    cout<<endl;
}
int dp[200002];

void solve(){
    int n;cin>>n;

    int fib[n];
    fib[0]=1;
    fib[1]=2;
    for(int i=2;i<n;i++){
        fib[i] = fib[i-1]+fib[i-2];
    }
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=fib[i];
        ans%=mod;
    }
    cout<<ans%mod<<endl;
}
signed main()
{
    fast;
    int t=1;//cin>>t;
    while(t--){
       solve();
	}

}

#include <iostream>
#include <vector>
using namespace std;

//let sequence start with one's
int main(){
    int n = 0;
    cin>>n;
    if(n == 1){
        cout<<1<<endl;
    }
    else{
        vector<int> ones(n+1);
        vector<int> zeros(n+1);
        ones[1] = 1;
        zeros[1] = 0;
        ones[2] = 1;
        zeros[2] = 2;
        for(int i = 3; i <= n; i++){
            if(i%2){
                zeros[i] = zeros[i-1];
                ones[i] = zeros[i-1]+1;
            }
            else{
                ones[i] = ones[i-1];
                zeros[i] = ones[i-1]+1;
            }
        }
        cout<<ones[n]+zeros[n]<<endl;
    }
    return 0;
}

#include<stdio.h>
#include<iostream>
#include<algorithm>
#define M 1000000007
using namespace std;
int main()
{
   long long a[4];
   int i,j,n;
   while(cin>>n){
	        a[0]=0,a[1]=1,a[2]=3,a[3]=6;
        for(i=3;i<=n;i++)
			a[i%4]=(2*a[(i-1)%4]-a[(i-3)%4])%M;
		printf("%lld\n",a[(i-1)%4]);
   }
  return 0;
}

#include <iostream>
#include <cmath>
#include <fstream>

using namespace std;

const int dim = 1000003;

int n,dp[dim];

int main()
{
    cin >> n;
    dp[1] = 1;
    dp[2] = 3;
    dp[3] = 6;
    dp[4] = 11;
    if (n == 1)
    {
        cout << "1";
        return 0;
    }
    if (n == 2)
    {
        cout << "3";
        return 0;
    }
    if (n == 3)
    {
        cout << "6";
        return 0;
    }
    for (int i=4; i<=n; i++)
    {
        dp[i] = 2*dp[i-1] - dp[i-3];
    }
    cout << dp[n];
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll sum[1000001];
int main(){
	ll n,tong=3,mod=1e9;
	cin>>n;
	sum[1]=1,sum[2]=2;
	for(int i=3;i<=n;i++){
		sum[i]=(sum[i-1]+sum[i-2])%mod;
		tong=(tong+sum[i])%mod;
	}
	if(n==1) cout<<1;
	else cout<<tong;
}

#include <stdio.h>
#include <algorithm>
#define MOD 1000000009
using namespace std;
int d[100010]={0},sum[2]={0};
int main(){
#ifndef ONLINE_JUDGE
	freopen("prob.in","r",stdin);
#endif
	int n;
	scanf("%d",&n);
	sum[1]=1;
	sum[0]=2;
	for(int i=3; i<=n; i++){
		d[i]=sum[(i+1)%2]+1;
		sum[i%2]=(d[i]+sum[i%2])%MOD;
	}
	printf("%d",sum[0]+sum[1]);
	return 0;
}

#include <bits/stdc++.h>
#define thicc(boi) boi.size()
#define magiczne ios_base::sync_with_stdio(0);
#define linijki	cin.tie(NULL);

using namespace std;

const int q = 1e9 + 7;

int main()
{
	magiczne linijki
	int n, odd = 1, even = 0;
	cin >> n;
	for (int i = 2;i<=n;i++)
	{
		if (i % 2 == 0)
			even += odd + 1;
		else odd += even + 1;
	}
	cout << odd + even;
	return 0;
}

#include <cstdio>
using namespace std;

const int INF = 1000000007;

int main(){
    int n,dp[2]={1,1};
    scanf("%d",&n);
    for(int i=0;i<n;i++) dp[i&1]=(dp[i&1]+dp[~i&1])%INF;
    printf("%d\n",dp[0]+dp[1]-2);
}

#include <iostream>
#include <vector>
using namespace std;
int main()
{
   int b; cin >> b;
   long long red=0;
   long long blue=0;
   long long MOD= 1000000007;
   for (int g=b-1; g>=0; g--)
   {
       if (g%2==0)
       {
           red=red+blue+1;
       }
       else
       {
           blue=blue+red+1;
       }
   }
   cout << (red+blue)%MOD;

}

#include <cmath>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<cctype>
#include <iomanip>
#include <string>
#include <sstream>

#include <functional>
#include <numeric>
#include <stack>
#include <climits>
#include <float.h>
#include<unordered_map>
#include <bitset>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define f(i,a,b) for(int i=a;i<b;i++)
#define F(i,a,b) for(int i=a;i>=    b;i--)
#define sz(a) ((int)a.size())
#define all(c) c.begin(), c.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define dbgs(x) cerr << (#x) << " --> " << (x) << ' '
#define dbg(x) cerr << (#x) << " --> " << (x) << endl
#define sz(a) ((int)a.size())

//#define fast ios_base::sync_with_stdio(0);cin.tie(0) ;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;

typedef vector<pair<int, int> > vpii;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef long double ld;

template <class T> const T& max(const T& a, const T&b, const T&c) { return max(a, max(b, c)); }

template <class T> const T& min(const T& a, const T&b, const T&c) { return min(a, min(b, c)); }

void sc(int &a) { scanf("%d", &a); }void sc(ll &a) { scanf("%lld", &a); }void sc(int& a, int& b) { sc(a); sc(b); }
void sc(ll &a, ll &b) { sc(a); sc(b); }void sc(int& a, int& b, int& c) { sc(a, b); sc(c); }void sc(ll& a, ll& b, ll& c) { sc(a, b); sc(c); }
void prl(int a) { printf("%d\n", a); }void prl(ll a) { printf("%lld\n", a); }void prl() { printf("\n"); }
void prs(int a) { printf("%d ", a); }void prs(ll a) { printf("%lld ", a); }

ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }

ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

ll poww(ll a, ll b) {

	if (b == 0) return 1;

	ll tmp = poww(a, b / 2);

	return (b & 1 ? a * tmp * tmp : tmp * tmp);

}

ll sumOfDigs(string s) { ll sum = 0; for (int i = 0; i < s.length(); i++) sum += s[i] - '0'; return sum; }

ll sumOfDigs(ll n) { return (n < 10 ? n : n % 10 + sumOfDigs(n / 10)); }

string itos(ll i) { string s = ""; 	while (i) { s += char(i % 10 + '0'); i /= 10; } reverse(all(s));  return s; }

ll stoi(string &s) { ll tot = 0; for (int i = (int)s.length() - 1, j = 1; i >= 0; i--, j *= 10) { tot += j * (s[i] + '0'); }  return tot; }

int months[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

using namespace std;

#define PI acos((ld)-1.0)

// printf("%.8lf\n", sum * 1.0 / n);  // precision setting

ll mod = 1e9 + 7;

void tt() {

#ifndef online	_judge
	freopen("test.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

#endif
}

ll modpower(ll x, ll y, ll p)
{

	x %= mod;

	if (!y) return 1;

	ll res = 1;

	if (y & 1) { res *= x;  res %= p; }

	ll z = modpower(x, y / 2, p);

	z %= p;

	z *= z;

	z %= mod;

	res *= z;

	res %= p;

	return res;

}

ll  dp[1000 * 1000 + 10];

ll dfs(int i) {

	if (i <= 0) { return  0;  }

	if (i == 1) { dp[i] = 1;  return 1; }

	if (dp[i] != -1) { return dp[i]; }

	ll res = 1;

	int j = i - 1;

	while (j > 0) {

		res += dfs(j) % mod;
		j -= 2;

	}

	dp[i] = res % mod;

	return res;

}

int main() {

	//tt();
	fast;
	int n = 5;

	memset(dp, -1, sizeof(dp));

	ll tot = 0;

	dfs(n);

	dfs(n - 1);

	for (int i = 1; i <= n; i++) tot += dp[i] % mod;

	cout << tot% mod << endl;

	return  0;

}

#include<iostream>
#include<cmath>
using namespace std;
long long n , i , m , k , l , s , t , a[101] , b;
int main()
{
    cin >> n ;
    s = ((n + 1 )* n)/ 2;
    k = 4 ;
    t = 3 ;
    while (n >= k)
    {
        s += (n - k + 1) / 2;
        k += 2;
    }
    while (n >= t)
    {
        s += (n - t + 1) / 2;
        t += 2;
    }
    if (n >= 5)
        s += 2;
    cout<<s;
    return 0;
}

/*input
3
*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define int ll
typedef vector <int> vi;
typedef vector<vi> vvi;
typedef map<int,int> mii;
typedef pair<int,int> pii;
#define pb push_back
#define INF 1000000000
#define mp make_pair
#define MOD 1000000007
#define F first
#define S second
const double PI=3.141592653589793238462643383279502884197169399375105820974944;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPD(i,n) for(int i=(n);i>=0;i--)
#define FORD(i,a,b) for(int i=(a);i>=b;i--)
#define all(v) v.begin(),v.end()
#define itr ::iterator it
#define WL(t) while(t --)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define remin(a,b) (a) = min((a),(b))
#define remax(a,b) (a) = max((a),(b))

signed main() {

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n;
	cin >> n;
	int dp[n+5],odd[n+5],even[n+5];
	odd[0] = even[0] = 0;
	dp[1] = 1;
	odd[1] = 1;
	even[1] = 0;
	FOR(i,2,n+1){
		dp[i] = 1;
		if(i%2 == 0){
			dp[i] += odd[i-1];
			even[i] = (even[i-1]+dp[i])%MOD;
			odd[i] = odd[i-1];
		}
		else{
			dp[i] += even[i-1];
			odd[i] = (odd[i-1]+dp[i])%MOD;
			even[i] = even[i-1];
		}
	}
	cout << odd[n]+even[n];
}