#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using Long=long long;

Long saa(Long a);
Long sba(Long a);
Long sab(Long a);
const Long cache_size=1e6;

Long saa(Long a) {
    static vector<Long> cache(cache_size);
    if(a==2) return 1;
    if(cache[a]!=0) return cache[a];
    const Long b = sba(a-1)%Long(1e9+7);
    cache[a]=b;
    return b;
}
Long sba(Long a) {
    static vector<Long> cache(cache_size);
    if(a==2) return 0;
    if(cache[a]!=0) return cache[a];
    const Long b = sab(a-1)%Long(1e9+7);
    cache[a]=b;
    return b;
}
Long sab(Long a) {
    static vector<Long> cache(cache_size);
    if(a==2) return 1;
    if(cache[a]!=0) return cache[a];
    const Long b = (sba(a-1) + saa(a-1))%Long(1e9+7);
    cache[a]=b;
    return b;
}

Long s(Long a) {
    if(a==1) return 1; // a
    if(a==2) return 2; // ab, aa
    return sab(a)+saa(a)+sba(a);
}

int main() {
    Long n;cin>>n;
    cout << s(n)%Long(1e9+7) << endl;
}