#include using namespace std; using i64 = long long; #define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++) #define all(x) x.begin(),x.end() #define STRINGIFY(n) #n #define TOSTRING(n) STRINGIFY(n) #define PREFIX "#" TOSTRING(__LINE__) "| " #define debug(x) \ { \ std::cout << PREFIX << #x << " = " << x << std::endl; \ } std::ostream& output_indent(std::ostream& os, int ind) { for(int i = 0; i < ind; i++) os << " "; return os; } template std::ostream& operator<<(std::ostream& os, const std::pair& p); template std::ostream& operator<<(std::ostream& os, const std::vector& v); template std::ostream& operator<<(std::ostream& os, const std::pair& p) { return (os << "(" << p.first << ", " << p.second << ")"); } template std::ostream& operator<<(std::ostream& os, const std::vector& v) { os << "["; for(int i = 0;i < v.size();i++) os << v[i] << ", "; return (os << "]"); } template static inline std::vector ndvec(size_t&& n, T val) { return std::vector(n, std::forward(val)); } template static inline auto ndvec(size_t&& n, Tail&&... tail) { return std::vector(tail)...))>(n, ndvec(std::forward(tail)...)); } int main() { string s; cin >> s; i64 a = s[0] - '0'; i64 b = s[1] - '0'; i64 c = s[2] - '0'; cout << std::max({ a, b, c }) - std::min({ a, b, c }) << endl; }