#include #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") // clang-format off /* #language C++ GCC */ __attribute__((constructor)) static void io_setup() noexcept {std::ios::sync_with_stdio(false);std::cin.tie(nullptr);} using namespace std; #if __has_include() #include #include #include #include // #include // #include #include using namespace atcoder; using namespace boost::multiprecision; // using boost::algorithm::join; using boost::algorithm::replace_all; // using cpp_double = cpp_bin_float_100; // using mint = modint1000000007; // using mint = modint998244353; #endif #ifdef LOCAL #include #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast(0)) #endif typedef string str; typedef long long ll; typedef long long lint; typedef long double ld; typedef unsigned long long ull; typedef vector vi; typedef vector vb; typedef vector vd; typedef vector vc; typedef vector vl; typedef vector vs; typedef vector> vvi; typedef vector> vvl; typedef vector> vvc; typedef vector> vvb; typedef pair pii; typedef pair pll; typedef vector vpi; typedef vector vpl; typedef mapmii; typedef mapmll; typedef deque dqi; typedef deque dql; template using umap = unordered_map; template using uset = unordered_set; template using mset = multiset; const int inf = INT_MAX / 2; const lint infl = 1LL << 60; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (lint i = lint(a); i < lint(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define rrep(i, n) for (lint i = n; i >= 0LL; i--) constexpr char nl = '\n'; #define fset fixed << setprecision(15) #define zset setfill('0') << right #define fcout cout << fset #define zcout(n) cout << zset << setw(n) // nで桁指定 #define all(a) (a).begin(), (a).end() #define rall(x) (x).rbegin(), (x).rend() #define SUM(v) accumulate(all(v), (ll)0) #define MIN(v) *min_element(all(v)) #define MAX(v) *max_element(all(v)) #define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()) #define sz(c) (lint)(c).size() #define len(c) (lint)(c).size() #define pb push_back #define eb emplace_back #define pf push_front #define is insert #define lb lower_bound #define ub upper_bound #define fi first #define sc second #define bit(n) (1LL << (n)) #define yes() cout << "Yes" << '\n' #define no() cout << "No" << '\n' #define yn(n) cout << ((n) ? "Yes" : "No") << '\n' #define al(i, v) for (auto &i : v) #define alm(it, x) for (auto it = x.begin(); it != x.end(); it++) #define scan(x) al(i, x) cin >> i #define out(z) al(i, z) cout << i << ' '; #define co() cout << nl; #define rsort(a) sort(rall(a)) #define sort_(a) sort(all(a)); #define rsort_(a) sort(rall(a)); void exit_no(void){cout<<"No"< void exit_(T x){cout< vector div(T n){vector ret;for (T i = 1; i * i <= n; i++)if (!(n % i)){ ret.pb(i);if (i * i != n) ret.pb(n / i);}sort(all(ret)); return ret;} template bool is_over(T a,T b){return a>((2LL<<60)/b)?true:false;} ll digitnum(ll x, ll b = 10){ll ret = 0; for(; x; x /= b) ret++; return ret;} ll digitsum(ll x, ll b = 10){ll ret = 0; for(; x; x /= b) ret += x % b; return ret;} template T d_pow(T x, T n) {T ret = 1;while (n > 0){if (n & 1)ret *= x;x *= x;n >>= 1;}return ret;} template T nPr(T n, T r) {T i, result = 1;rep(i, r) { result *= (T)(n - i); }return result;} template T nCr(T n, T r){T i,result = 1;rep(i, min(r, n - r)){result *= (T)(n - i);result /= (T)(i + 1);}return result;} template T pow_mod(T A, T N, T M) {T res = 1 % M;A %= M;while (N){if (N & 1)res = (res * A) % M; A = (A * A) % M;N >>= 1;}return res; } bool is_prime(ll N) {if (N <= 1)return false;if (N == 2 || N == 3)return true;if (N % 2 == 0)return false;vl A = {2, 325, 9375, 28178, 450775,9780504, 1795265022};ll s = 0, d = N - 1;while (d % 2 == 0){++s;d >>= 1;}for (auto a : A){if (a % N == 0)return true;ll t, x = pow_mod<__int128_t>(a, d, N);if (x != 1){for (t = 0; t < s; ++t){if (x == N - 1)break;x = __int128_t(x) * x % N;}if (t == s)return false;}}return true;} // Pollard のロー法 ll gcd(ll A, ll B){A = abs(A), B = abs(B);if (B == 0)return A;else return gcd(B, A % B);} ll pollard(ll N) {if (N % 2 == 0)return 2;if (is_prime(N))return N;auto f = [&](ll x) -> ll {return (__int128_t(x) * x + 1) % N;};ll step = 0;while (true){++step;ll x = step, y = f(x);while (true){ll p = gcd(y - x + N, N);if (p == 0 || p == N)break;if (p != 1)return p;x = f(x);y = f(f(y));}}} vl prime_factorize(ll N){if (N == 1)return {};ll p = pollard(N);if (p == N)return {p};vl left = prime_factorize(p);vl right = prime_factorize(N / p);left.is(left.end(), right.begin(), right.end());sort(all(left));return left; } vl Prime_table(ll n) {vl v(n + 1, 1);v[0] = v[1] = 0; rep(i, 2, sqrtl(n)) if (v[i]) for (lint j = 0; i * (j + 2) < n; j++) v[i * (j + 2)] = 0;return v;} vl sieve(lint n) {vl res;vector mem(n, 0);for (int i = 2; i < n; i++){if (mem[i]){continue;}res.push_back(i);for (int j = i; j < n; j += i){mem[j] = 1;}}return res;} template string to_binary(T x){string bi = bitset<64>(x).to_string();return bi;} template T convert_base(string s,T k){T x = stoull(s,nullptr,k);return x;} lint convert_base2(string s){lint x = stoll(s,nullptr,(lint)2);return x;} template set operator|(set a, set b) {set ret;set_union(all(a), all(b), inserter(ret, ret.begin()));return ret;} template mset operator|(mset a, mset b) {mset ret;set_union(all(a), all(b), inserter(ret, ret.begin()));return ret;} template set operator&(set a, set b){set ret;set_intersection(all(a),all(b),inserter(ret,ret.begin()));return ret;} template mset operator&(mset a, mset b){mset ret;set_intersection(all(a),all(b),inserter(ret,ret.begin()));return ret;} template set operator-(set a, set b) {set ret;set_symmetric_difference(all(a),all(b),inserter(ret,ret.begin()));return ret;} template mset operator-(mset a, mset b) {mset ret;set_symmetric_difference(all(a),all(b),inserter(ret,ret.begin()));return ret;} template void input(T &...a){(cin >> ... >> a);} void print(){cout << '\n';} template void print(const T &a, const Ts &...b){cout << a; (cout << ... << (cout << ' ', b)); cout << '\n'; } int snx() {return getchar();} void snx(int &a) {cin>>a;} void snx(lint &a) {cin>>a;} void snx(ld &a) {cin>>a;} void snx(string &a) {cin>>a;} void snx(ull &a) {cin>>a;} void snx(char &a) {cin>>a;} //void snx(cpp_int &a){ cin>>a; } void in() {} template void in(Head &head, Tail &...tail){snx(head);in(tail...);} #define int_(...) int __VA_ARGS__;in(__VA_ARGS__) #define lint_(...) lint __VA_ARGS__;in(__VA_ARGS__) #define ld_(...) ld __VA_ARGS__;in(__VA_ARGS__) #define string_(...) string __VA_ARGS__;in(__VA_ARGS__) #define str_(...) string __VA_ARGS__;in(__VA_ARGS__) #define char_(...) char __VA_ARGS__;in(__VA_ARGS__) #define ull_(...) ull __VA_ARGS__;in(__VA_ARGS__) //#define cpp_int_(...) cpp_int __VA_ARGS__;in(__VA_ARGS__) #define vec_(type,ne,size)vectorne(size);scan(name); #define vi_(ne,sz) vi ne(sz);scan(ne); #define vb_(ne,sz) vb ne(sz);scan(ne); #define vd_(ne,sz) vd ne(sz);scan(ne); #define vc_(ne,sz) vc ne(sz);scan(ne); #define vl_(ne,sz) vl ne(sz);scan(ne); #define vs_(ne,sz) vs ne(sz);scan(ne); #define snn(h,w,a) rep(i,h)rep(j,w) cin >> a[i][j]; #define vvi_(ne,h,w) vvi ne(h,vi(w,0));snn(h,w,ne) #define vvl_(ne,h,w) vvl ne(h,vl(w,0));snn(h,w,ne) #define vvc_(ne,h,w) vvc ne(h,vc(w,0));snn(h,w,ne) #define vvb_(ne,h,w) vvb ne(h,vb(w,0));snn(h,w,ne) #define vpl_(ne,m) vpl ne(m); rep(i,m)cin>>ne[i].fi>>ne[i].sc; template bool chmin(T &a, const T &b) { return a > b ? a = b, true : false; } template bool chmax(T &a, const T &b) { return a < b ? a = b, true : false; } #define l_rot(s, n) rotate(all(s) + (n), s.end()); #define r_rot(s, n) rotate(rall(s) + (n), s.rend()); const ld PI = acos(-1.0); const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; const string abc = "abcdefghijklmnopqrstuvwxyz"; // map mp; // map mmp; template void c_compress(vector &a){T i; vector b = a;sort(b.begin(), b.end());b.erase(unique(b.begin(), b.end()), b.end());vector res(a.size());for (T i = 0; i < a.size(); i++){auto z = lower_bound(b.begin(), b.end(), a[i]) - b.begin(); res[i] = z; /*mp[a[i]] = z; // 大->小 mmp[z] = a[i]; // 小->大*/ }} template using pq = priority_queue; template using pqg = priority_queue, greater>; ll arith(ll x) { return x * (x + 1) / 2; } ll arith2(ll a, ll d, ll n){return n * (2 * a + (n - 1) * d) / 2; } template vector ret_ex(vector v) { T n = len(v); vector e(n + 1, 0); rep(i, 1, n + 1) e[i] = e[i - 1] + v[i - 1]; return e; } bool is_out(ll y,ll x,ll h,ll w){return (y<0||y>=h||x<0||x>=w);} //頂点数n,ソート済みを返すtp,グラフG bool t_sort(lint n, vl &tp, vvl G) {bool jud = false;vb se(n + 1, false);vb fn(n, false);auto ddfs = [&](auto ddfs, int v) -> void {se[v] = true;for (auto next : G[v]){if (se[next] && !fn[next])jud = true;if (se[next])continue;ddfs(ddfs, next);}fn[v] = true;tp.eb(v);};rep(i, n) if (!se[i]) ddfs(ddfs, i);reverse(all(tp));return jud;} const vl dx = {1,0,-1,0}; const vl dy = {0,1,0,-1}; const vl dx8 = {1, 1, 1, 0, 0, -1, -1, -1}; const vl dy8 = {1, 0, -1, 1, -1, 1, 0, -1}; struct edge{lint to, cost;}; #define beg begin template using vv = vector>; // clang-format on bool flg(lint x, lint i) { return (lint)x & (1 << i); } int main() { lint_(n); vl_(a, n); print(SUM(a)); }